1. 程式人生 > >NodeJS 安裝不存在的模塊

NodeJS 安裝不存在的模塊

reg 分享 org mage 安裝 dev image sem shell

設置npm鏡像:

npm config set registry  https://registry.npm.taobao.org

我遇到的報錯情況:

Error: Cannot find module ‘chalk‘

Error: Cannot find module ‘semver‘

Error: Cannot find module ‘shelljs‘

Error: Cannot find module ‘child_process‘

不同的項目依賴於不同的模塊,這些模塊都需要自己安裝。

運行npm run dev 錯誤:

技術分享

報模塊不存在錯誤,這個需要自己安裝。

npm安裝模塊語法:

npm install {module} --save  

技術分享

NodeJS 安裝不存在的模塊