练习项目npm start启动时报错的个人解决办法
错误原因这几天在学习react,跟着慕课网的视频学习。 在用yeoman最初构建项目,完成后需要启动项目。 > @0.0.1 start E:workspaceloveGallery-by-react > node server.js --env=dev module.js:471 throw err; ^ Error: Cannot find module 'core-js/fn/object/assign' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> (E:workspaceloveGallery-by-reactserver.js:3:1) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:Program Filesnodejsnode.exe" "C:Program Filesnodejsnode_modulesnpmbinnpm-cli.js" "start" npm ERR! node v6.9.1 npm ERR! npm v3.10.8 npm ERR! code ELIFECYCLE npm ERR! @0.0.1 start: `node server.js --env=dev` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @0.0.1 start script 'node server.js --env=dev'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do,this is most likely a problem with the package,npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node server.js --env=dev npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs npm ERR! Or if that isn't available,you can get their info via: npm ERR! npm owner ls npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! E:workspaceloveGallery-by-reactnpm-debug.log 看了一下Error,是说找不到core-js/fn/object/assign这个文件。 解决方案找到原因就可以针对解决。好了少了core-js,那咱们就安装这个。运行 这下不知道怎么解决了,然后找网上的解决方案,有一种方式说运行 没招也不能放弃啊,继续上网找吧。找到一个说使用npm在国内安装模块很慢,有时候还不成功,推荐使用淘宝npm镜像,我就想项目中缺少那个模块是不是就是因为npm安装模块出了问题,没有安装上? npm install -g cnpm --registry=https://registry.npm.taobao.org 通过这个命令安装cnpm,之后运行 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |