Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dva创建应用报错 #436

Closed
fanpaa opened this issue Dec 27, 2016 · 6 comments
Closed

dva创建应用报错 #436

fanpaa opened this issue Dec 27, 2016 · 6 comments

Comments

@fanpaa
Copy link

fanpaa commented Dec 27, 2016

➜ 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

@sorrycc
Copy link
Member

sorrycc commented Dec 27, 2016

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

@sorrycc
Copy link
Member

sorrycc commented Dec 27, 2016

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

@fanpaa
Copy link
Author

fanpaa commented Dec 27, 2016

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

@fanpaa fanpaa closed this as completed Dec 27, 2016
@feiZhang
Copy link

feiZhang commented Mar 8, 2017

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

@sorrycc sorrycc mentioned this issue Mar 27, 2017
@zhoudanjun
Copy link

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

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

@sugar0828
Copy link

$ 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 文件。 网上也差不到资料。 不知道到底为什么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants