狼愛上貍

          我胡漢三又回來了

          nodejs-執行報錯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種方法是進入項目目錄再執行安裝express模塊,無效

          最后,原來是node_modules沒有配置環境變量

          配置上吧:

          1、控制面板\所有控制面板項\系統\高級系統設置\環境變量

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

           編輯增加環境變量‘PATH’

          完美~~


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


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

          主站蜘蛛池模板: 湛江市| 云和县| 怀化市| 宕昌县| 乐安县| 亳州市| 柘荣县| 高平市| 福安市| 怀来县| 清河县| 满洲里市| 大理市| 康乐县| 轮台县| 塘沽区| 嘉兴市| 怀远县| 崇仁县| 庆安县| 额尔古纳市| 日照市| 恩平市| 博爱县| 南康市| 郸城县| 慈利县| 大悟县| 冷水江市| 万荣县| 奇台县| 佛山市| 晋城| 四会市| 喀什市| 南开区| 萝北县| 青神县| 孝义市| 通化市| 莆田市|