不能运行npm run serve,我已经运行了npm update,但仍然保持错误



当我运行npm run server时,这个错误一直出现

Error: Cannot find module './editor-info/linux'
Require stack:
- C:UsersLENOVODesktopcovidcare-ytu-clinicnode_moduleslaunch-editorguess.js
- C:UsersLENOVODesktopcovidcare-ytu-clinicnode_moduleslaunch-editorindex.js
- C:UsersLENOVODesktopcovidcare-ytu-clinicnode_modules@vuecli-shared-utilsliblaunch.js    
- C:UsersLENOVODesktopcovidcare-ytu-clinicnode_modules@vuecli-shared-utilsindex.js
- C:UsersLENOVODesktopcovidcare-ytu-clinicnode_modules@vuecli-servicebinvue-cli-service.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (C:UsersLENOVODesktopcovidcare-ytu-clinicnode_moduleslaunch-editorguess.js:9:30)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\Users\LENOVO\Desktop\covidcare-ytu-clinic\node_modules\launch-editor\guess.js',
'C:\Users\LENOVO\Desktop\covidcare-ytu-clinic\node_modules\launch-editor\index.js',
'C:\Users\LENOVO\Desktop\covidcare-ytu-clinic\node_modules\@vue\cli-shared-utils\lib\launch.js',  
'C:\Users\LENOVO\Desktop\covidcare-ytu-clinic\node_modules\@vue\cli-shared-utils\index.js',        
'C:\Users\LENOVO\Desktop\covidcare-ytu-clinic\node_modules\@vue\cli-service\bin\vue-cli-service.js'
]
}
我已经运行npm update,但这个错误不断出现。我是新的价值项目,这个bug正在打破我的病人....请救救我吧。这是我的package.json{ "name": "covidcare-ytu", "version": "0.1.0", "private": true, "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", "test:unit": "vue-cli-service test:unit", "lint": "vue-cli-service lint" }, "dependencies": { "@vuelidate/core": "^2.0.0-alpha.26", "@vuelidate/validators": "^2.0.0-alpha.22", "axios": "^0.21.4", "chart.js": "^3.5.1", "core-js": "^3.6.5", "es-abstract": "^1.18.6", "firebase": "^9.0.0", "nprogress": "^0.2.0", "primeflex": "^2.0.0", "primeicons": "^4.1.0", "primevue": "^3.7.0", "prismjs": "^1.24.1", "uuid": "^8.3.2", "vue": "^3.2.6", "vue-axios": "^3.3.7", "vue-router": "^4.0.0-0", "vuex": "^4.0.0-0" }, "devDependencies": { "@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-eslint": "^3.1.1", "@vue/cli-plugin-router": "~4.5.0", "@vue/cli-plugin-unit-jest": "^4.5.13", "@vue/cli-plugin-vuex": "~4.5.0", "@vue/cli-service": "^4.5.13", "@vue/compiler-sfc": "^3.0.0", "@vue/eslint-config-prettier": "^6.0.0", "@vue/test-utils": "^2.0.0-0", "babel-eslint": "^10.1.0", "eslint": "^6.7.2", "eslint-plugin-prettier": "^3.3.1", "eslint-plugin-vue": "^7.0.0", "prettier": "^2.2.1", "sass": "^1.26.5", "sass-loader": "^8.0.2", "typescript": "~3.9.3", "vue-jest": "^5.0.0-0" } }

这里是babel.config.js

module.exports = { presets: ['@vue/cli-plugin-babel/preset'], }

那么,因为您在某个地方有需要或有Linux依赖的库,我建议您创建一个包的备份。删除"@vue-cli"用这个:

npm uninstall @vue/cli

然后重新安装:

npm install -g @vue/cli

另一个可以尝试的解决方案是用以下方式更新npm:

npm install npm@latest -g

然后删除文件夹"node-modules"清除已安装在项目上的所有库,然后使用以下命令安装:

npm install

相关内容

  • 没有找到相关文章

最新更新