配置完访问报错,求解答!!?
发布于 10 年前 作者 weeho 9679 次浏览 最后一次编辑是 8 年前
Error: Cannot find module 'source-map'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/home/hw/node/web/nodejs-demo/node_modules/jade/node_modules/transformers/node_modules/uglify-js/tools/node.js:9:21)
at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17) at require (module.js:384:17)
at Object.<anonymous> (/home/hw/node/web/nodejs-demo/node_modules/jade/node_modules/transformers/lib/transforme 

我的express 和 node 都是 全局安装的,用 express nodejs-demo 创建完项目后,也有用 npm install -d 在项目文件夹里关联引用 用 npm start启动后直接报上面这个错了!!

在package.json 里加入 “source-map”:"~0.1.34" npm install后出现下面的错误

npm WARN unmet dependency /home/hw/node/web/nodejs-demo/node_modules/jade/node_modules/with/node_modules/uglify-js requires source-map@‘0.1.34’ but will load npm WARN unmet dependency /home/hw/node/web/nodejs-demo/node_modules/source-map, npm WARN unmet dependency which is version 0.1.37 npm WARN unmet dependency /home/hw/node/web/nodejs-demo/node_modules/jade/node_modules/constantinople/node_modules/uglify-js requires source-map@‘0.1.34’ but will load npm WARN unmet dependency /home/hw/node/web/nodejs-demo/node_modules/source-map, npm WARN unmet dependency which is version 0.1.37

2 回复

package.json里面加上source-map的依赖先

@JacksonTian 在package.json 里加入 “source-map”:"~0.1.34" npm install后出现下面的错误

npm WARN unmet dependency /home/hw/node/web/nodejs-demo/node_modules/jade/node_modules/with/node_modules/uglify-js requires source-map@‘0.1.34’ but will load npm WARN unmet dependency /home/hw/node/web/nodejs-demo/node_modules/source-map, npm WARN unmet dependency which is version 0.1.37 npm WARN unmet dependency /home/hw/node/web/nodejs-demo/node_modules/jade/node_modules/constantinople/node_modules/uglify-js requires source-map@‘0.1.34’ but will load npm WARN unmet dependency /home/hw/node/web/nodejs-demo/node_modules/source-map, npm WARN unmet dependency which is version 0.1.37

http://zhidao.baidu.com/question/263429208936946005.html

回到顶部