我正在将一个Vue.js应用程序移动到一个新的存储库中,从它的旧主机中提取它。
在这一点上,我已经字面上复制的应用程序从一个文件夹到另一个,但它不会建立。它建立在第一个文件夹,但不是在第二个。
只要我输入npm run build
/npm run build-app-only
(或其他任何东西),我就得到了这个...npm ERR! missing script: vue-cli-service
或node-sass is not recognised as an internal or external command
这是我的软件包的脚本部分。json....
"scripts": {
"serve-vstudio": "npm run messaging-css && vue-cli-service serve",
"serve": "npm run messaging-css && vue-cli-service serve --port 8080",
"build": "npm run messaging-css && vue-cli-service build",
"build-app-only": "npm run vue-cli-service build",
"build-debug": "npm run messaging-css && vue-cli-service build --mode staging",
"test": "vue-cli-service test:unit \"\\.*\\.spec\\.js$\" --testPathIgnorePatterns=\"\\long/.*\\.spec\\.js$\"",
"test-all": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" vue-cli-service test:unit \"\\.*\\.spec\\.js$\"",
"test-long": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" vue-cli-service test:unit \"\\long/.*\\.spec\\.js$\"",
"test-ci": "vue-cli-service test:unit \"\\.*\\.spec\\.js$\" --testPathIgnorePatterns=\"\\long/.*\\.spec\\.js$\"",
"test-clear": "jest --clearCache",
"test-watch": "vue-cli-service test:unit \"\\.*\\.spec\\.js$\" --testPathIgnorePatterns=\"\\long/.*\\.spec\\.js$\" --watch",
"test-watch-all": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" vue-cli-service test:unit \"\\.*\\.spec\\.js$\" --watch",
"test-watch-long": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" vue-cli-service test:unit \"\\long/.*\\.spec\\.js$\" --watch",
"lint": "vue-cli-service lint",
"dev": "vue-cli-service serve",
"test:unit": "vue-cli-service test:unit",
"view-cfg": "vue inspect > standard.config.js",
"watch": "vue-cli-service build --mode development --watch",
"messaging-css-ecofurb": "node-sass src/scss/schemes/messaging/ecofurb.scss -o public/schemes/ecofurb/css --output-style compressed & node-sass src/scss/schemes/messaging/ecofurb.scss -o ../plan-builder/schemes/ecofurb/css --output-style compressed",
"messaging-css-oxfordshire": "node-sass src/scss/schemes/messaging/oxfordshire.scss -o public/schemes/oxfordshire/css --output-style compressed && node-sass src/scss/schemes/messaging/oxfordshire.scss -o ../plan-builder/schemes/oxfordshire/css --output-style compressed",
"messaging-css-parity": "node-sass src/scss/schemes/messaging/parity.scss -o public/schemes/parity/css --output-style compressed && node-sass src/scss/schemes/messaging/parity.scss -o ../plan-builder/schemes/parity/css --output-style compressed",
"messaging-css-radbot": "node-sass src/scss/schemes/messaging/radbot.scss -o public/schemes/radbot/css --output-style compressed & node-sass src/scss/schemes/messaging/radbot.scss -o ../plan-builder/schemes/radbot/css --output-style compressed",
"messaging-css-warmersussex": "node-sass src/scss/schemes/messaging/warmersussex.scss -o public/schemes/warmersussex/css --output-style compressed && node-sass src/scss/schemes/messaging/warmersussex.scss -o ../plan-builder/schemes/warmersussex/css --output-style compressed",
"messaging-css": "npm run messaging-css-ecofurb && npm run messaging-css-oxfordshire && npm run messaging-css-parity && npm run messaging-css-radbot && npm run messaging-css-warmersussex"
},
,
"dependencies": {
"ajv": "^5.0.0",
"arg-guard": "^1.0.3",
"axios": "^0.18.0",
"breakpoint-sass": "^2.7.1",
"core-js": "^2.6.5",
"delay": "^4.3.0",
"localforage": "^1.7.3",
"lodash": "^4.17.11",
"moment": "^2.24.0",
"onload-function-stack": "^1.2.0",
"susy": "^3.0.5",
"uri-path-manager": "^1.0.4",
"uuid": "^3.3.2",
"vee-validate": "^2.1.3",
"vue": "2.6.7",
"vue-analytics": "^5.17.2",
"vue-recaptcha": "^1.1.1",
"vue-router": "3.0.1",
"vuedraggable": "^2.20.0",
"vuex": "^3.0.1",
"window-wrapper": "^1.2.0"
},
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.7.2",
"@vue/cli-plugin-babel": "^3.2.0",
"@vue/cli-plugin-eslint": "^3.2.0",
"@vue/cli-plugin-unit-jest": "^3.10.0",
"@vue/cli-service": "^3.5.2",
"@vue/eslint-config-airbnb": "^4.0.0",
"@vue/server-test-utils": "1.0.0-beta.29",
"@vue/test-utils": "1.0.0-beta.29",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
"browserslist": "^4.12.0",
"caniuse-lite": "^1.0.30001059",
"cheerio": "^1.0.0-rc.3",
"cross-env": "^7.0.2",
"eslint": "^5.8.0",
"eslint-config-prettier": "^3.3.0",
"eslint-plugin-vue": "^5.0.0-0",
"flush-promises": "^1.0.2",
"happy-dom": "^0.14.1",
"imagemin-webpack-plugin": "^2.4.2",
"jest-junit-reporter": "^1.1.0",
"lint-staged": "^7.2.2",
"node-sass": "^4.10.0",
"normalize-scss": "^7.0.1",
"postcss-import": "^12.0.1",
"postcss-url": "^8.0.0",
"sass-loader": "^7.0.1",
"vue-server-renderer": "2.6.7",
"vue-template-compiler": "2.6.7"
}
我从根文件夹运行,package.json位于该文件夹。
我试过在另一个文件夹中制作另一份副本(那也坏了)。
我再次尝试手动运行npm i
(尽管我复制了所有文件)。
我已经搜索了互联网,但所有的解决方案似乎都围绕着脚本没有被发现是一个自定义脚本,但事实并非如此-我定义的脚本被发现很好,但从脚本本身调用似乎不再工作,因为移动。
2条答案
按热度按时间vxf3dgd41#
这不是关于
scripts
部分,而是关于dependencies
。全局安装,如here所示:
如果仍然不起作用,请添加dev依赖项:
snz8szmq2#
“watch”:“vue-cli-service serve --open”只要将这一行添加到你的脚本中的package. json文件中的脚本对象中,问题就解决了。