[英]Cannot find module 'C:\node_modules\npm\bin\npm-cli.js
I download loopback project from github and trying to run it .我从 github 下载环回项目并尝试运行它。 When I type npm start I am getting following errors in console window .当我输入 npm start 时,控制台窗口中出现以下错误。
C:\Users\Khundokar Nirjor\Desktop\loop4\loopback4-example-shopping> npm start
> loopback4-example-shopping-monorepo@1.0.0 prestart C:\Users\Khundokar Nirjor\Desktop\loop4\loopback4-example-shopping
> npm run build
> loopback4-example-shopping-monorepo@1.0.0 build C:\Users\Khundokar Nirjor\Desktop\loop4\loopback4-example-shopping
> lerna run build
internal/modules/cjs/loader.js:628
throw err;
^
Error: Cannot find module 'C:\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
at Function.Module._load (internal/modules/cjs/loader.js:527:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)
at internal/main/run_main_module.js:17:11 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Are you doing "npm install" command before npm start?你在 npm start 之前执行“npm install”命令吗?
Any project you are cloning from git it won't have node_modules(which is having necessary library to run that application).您从 git 克隆的任何项目都不会具有 node_modules(它具有运行该应用程序所需的库)。
While "npm install" command, it will download all the required libraries based on your package.json/package-lock.json.当“npm install”命令时,它会根据你的 package.json/package-lock.json 下载所有需要的库。
If already you run "npm install", you can fix this issue using below command如果您已经运行“npm install”,则可以使用以下命令解决此问题
npm i npm-cli --save npm i npm-cli --save
您需要在本地安装打字稿。
yarn global add typescript
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.