我有一个VueJS 2。我在Visual Studio Code中编写了一个我从3年前就没碰过的x应用程序。
今天我想构建它,所以我设置我的nodejs
版本为12.0.0通过使用:
NVM USE 12.0.0
,然后删除node_modules文件夹和package-lock。Json并输入到终端:
npm install
一切正常,没有错误,然后我输入:
npm run serve
我得到了以下错误:
> vue-cli-service serve
/c/Dev/TestVue/node_modules/.bin/vue-cli-service: line 2: sed: command not found
/c/Dev/TestVue/node_modules/.bin/vue-cli-service: line 2: dirname: command not found
/c/Dev/TestVue/node_modules/.bin/vue-cli-service: line 4: uname: command not found
internal/modules/cjs/loader.js:613
throw err;
^
Error: Cannot find module 'C:@vuecli-servicebinvue-cli-service.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
at Function.Module._load (internal/modules/cjs/loader.js:526:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:826:10)
at internal/main/run_main_module.js:17:11
This is killing me because I remember it was working perfectly so not sure if maybe I'm not using the right versions of node.
这是我的package.json的内容
{
"name": "testapp",
"version": "0.1.0",
"private": true,
"scripts": {
"serve:local": "vue-cli-service serve --mode local",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@grapecity/wijmo.all": "^5.20192.624",
"@mdi/js": "^3.4.93",
"@vue/cli": "^3.4.0",
"axios": "^0.18.0",
"chart.js": "^2.7.3",
"core-js": "^2.6.5",
"element-ui": "^2.4.11",
"lodash": "^4.17.11",
"momentjs": "^2.0.0",
"pusher-js": "^4.4.0",
"register-service-worker": "^1.6.1",
"vue": "^2.6.6",
"vue-chartjs": "^3.4.0",
"vue-i18n": "^8.8.1",
"vue-js-modal": "^1.3.31",
"vue-on-click-outside": "^1.0.3",
"vue-router": "^3.0.2",
"vue-session": "^1.0.0",
"vuedraggable": "^2.23.0",
"vuex": "^3.1.0",
"vuex-persistedstate": "^2.5.4"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.4.0",
"@vue/cli-plugin-eslint": "^3.4.0",
"@vue/cli-plugin-pwa": "^3.4.0",
"@vue/cli-service": "^3.4.0",
"@vue/eslint-config-prettier": "^3.0.5",
"axios": "^0.18.0",
"eslint-loader": "^2.1.2",
"node-sass": "^4.14.1",
"pug": "^2.0.3",
"pug-plain-loader": "^1.0.0",
"sass-loader": "^7.0.3",
"vue-cli-plugin-axios": "0.0.4",
"vue-cli-plugin-element": "^1.0.1",
"vue-cli-plugin-i18n": "^0.5.1",
"vue-template-compiler": "^2.6.6"
}
}
我使用节点v16解决了这个问题