狼愛上貍

          我胡漢三又回來了

          nodejs-執(zhí)行報錯Error: Cannot find module 'express'

          1. C:\Users\0>node E:\項目\2018年\11月份\nodejs\express_demo.js
          2. module.js:471
          3. throw err;
          4. ^
          5. Error: Cannot find module 'express'
          6. at Function.Module._resolveFilename (module.js:469:15)
          7. at Function.Module._load (module.js:417:25)
          8. at Module.require (module.js:497:17)
          9. at require (internal/module.js:20:19)
          10. at Object.<anonymous> (E:\項目\2018年\11月份\nodejs\express_demo.js:1:77)
          11. at Module._compile (module.js:570:32)
          12. at Object.Module._extensions..js (module.js:579:10)
          13. at Module.load (module.js:487:32)
          14. at tryModuleLoad (module.js:446:12)
          15. at Function.Module._load (module.js:438:3)
          16. C:\Users\0>express --version
          17. 4.16.0

          實際上我是有安裝express模塊的

          奇了個怪了。

          然后試過1種方法是進入項目目錄再執(zhí)行安裝express模塊,無效

          最后,原來是node_modules沒有配置環(huán)境變量

          配置上吧:

          1、控制面板\所有控制面板項\系統(tǒng)\高級系統(tǒng)設置\環(huán)境變量

          新建設‘NODE_PATH’:C:\Users\0\AppData\Roaming\npm\node_modules

           編輯增加環(huán)境變量‘PATH’

          完美~~


          http://www.pianshen.com/article/837378161/


          posted on 2019-06-23 22:31 狼愛上貍 閱讀(1596) 評論(0)  編輯  收藏 所屬分類: Blockchain

          主站蜘蛛池模板: 英德市| 定安县| 通化市| 昌邑市| 卓资县| 霍林郭勒市| 喀喇| 竹溪县| 吉林市| 台前县| 城固县| 满洲里市| 宁国市| 溧水县| 密山市| 阿拉善左旗| 濮阳县| 东兴市| 衡阳市| 新泰市| 铜鼓县| 兴国县| 上虞市| 鄂温| 梁平县| 铜陵市| 大厂| 湖南省| 和硕县| 民县| 广河县| 佛山市| 永清县| 仁化县| 时尚| 平潭县| 内江市| 莎车县| 镶黄旗| 瓦房店市| 南城县|