dva icon indicating copy to clipboard operation
dva copied to clipboard

dva创建应用报错

Open fanpaa opened this issue 9 years ago • 6 comments

➜ dva-demo dva new user-dashboard2 /usr/local/opt/nvm/versions/node/v7.3.0/lib/node_modules/dva-cli/bin/dva-new Creating a new Dva app in /Users/fyh/WebstormProjects/dva-demo/user-dashboard2.

  create  .editorconfig
  create  .eslintrc
  create  .roadhogrc
  create  gitignore
  create  package.json
  create  src/index.css
  create  src/index.html
  create  src/index.js
  create  src/router.js
  create  src/assets/yay.jpg
  create  src/components/Example.js
  create  src/models/example.js
  create  src/routes/IndexPage.css
  create  src/routes/IndexPage.js
  create  src/services/example.js
  create  src/utils/request.js
  rename  gitignore -> .gitignore
     run  npm install

use npm: cnpm module.js:472 throw err; ^

Error: Cannot find module 'internal/fs' at Function.Module._resolveFilename (module.js:470:15) at Function.Module._load (module.js:418:25) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at evalmachine.:17:20 at Object. (/usr/local/lib/node_modules/cnpm/node_modules/npm/node_modules/npm-registry-client/node_modules/graceful-fs/fs.js:11:1) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) module.js:472 throw err; ^

Error: Cannot find module 'internal/fs' at Function.Module._resolveFilename (module.js:470:15) at Function.Module._load (module.js:418:25) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at evalmachine.:17:20 at Object. (/usr/local/lib/node_modules/cnpm/node_modules/npm/node_modules/npm-registry-client/node_modules/graceful-fs/fs.js:11:1) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) cnpm install end

Success! Created user-dashboard2 at /Users/fyh/WebstormProjects/dva-demo/user-dashboard2.

Inside that directory, you can run several commands:

  • npm start: Starts the development server.
  • npm run build: Bundles the app into dist for production.
  • npm test: Run test.

We suggest that you begin by typing: cd /Users/fyh/WebstormProjects/dva-demo/user-dashboard2 npm start

Happy hacking! ➜ dva-demo

fanpaa avatar Dec 27 '16 03:12 fanpaa

难以阅读,请参考以下文档调整下格式:

  • https://segmentfault.com/markdown
  • https://guides.github.com/features/mastering-markdown/

sorrycc avatar Dec 27 '16 04:12 sorrycc

好像是 cnpm 没安装好,你直接用 cnpm install 一个模块会报错吗?

sorrycc avatar Dec 27 '16 04:12 sorrycc

@sorrycc 谢谢。重新安装了cnpm,搞定😄

fanpaa avatar Dec 27 '16 05:12 fanpaa

脚本提示明明使用的npm安装的,为啥用到了cnpm了。把cnpm卸载了,也可以。。 不明白。

feiZhang avatar Mar 08 '17 01:03 feiZhang

F:\WebPro\dvapro>dva new dvatest C:\Users\Administrator\AppData\Roaming\npm\node_modules\dva-cli\bin\dva-new events.js:182 throw er; // Unhandled 'error' event ^

Error: spawn cmd ENOENT at exports._errnoException (util.js:1014:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:189:19) at onErrorNT (internal/child_process.js:366:16) at _combinedTickCallback (internal/process/next_tick.js:102:11) at process._tickCallback (internal/process/next_tick.js:161:9) at Function.Module.runMain (module.js:607:11) at startup (bootstrap_node.js:158:16) at bootstrap_node.js:575:3

创建项目报这个错 不知道是什么原因了

zhoudanjun avatar Jul 07 '17 09:07 zhoudanjun

$ dva new demoapp --demo

/usr/local/lib/node_modules/dva-cli/bin/dva-new Creating a new Dva app in /project/demoapp.

  create  .editorconfig
  create  gitignore
  create  package.json
  create  public/index.html
  create  src/index.ejs
  create  src/index.js
  create  src/index.less
  rename  gitignore -> .gitignore
     run  npm install

use npm: tnpm 基于:dva-cli version 0.9.2 然后并没有生成.roadhogrc 文件。 网上也差不到资料。 不知道到底为什么?

sugar0828 avatar Jan 15 '18 08:01 sugar0828