Umi: umi generate page index 报告找不到模板文件

Created on 24 Aug 2018  ·  3Comments  ·  Source: umijs/umi

我用的是 pnpm install -g umi

运行 umi generate page index

显示
E:\work_front2\myapp_umi_start> umi generate page index
[DEBUG] generate page index with isDirectory false
fs.js:646
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

Error: ENOENT: no such file or directory, open 'C:\Users\aa\AppData\Roaming\npm\pnpm-global\1\node_modules.registry.npmjs.org\umi\1.3.18\node_modules\umi\template\page.js'
at Object.fs.openSync (fs.js:646:18)
at fs.readFileSync (fs.js:551:33)
at Object._default [as page] (C:\Users\aa\AppData\Roaming\npm\pnpm-global\1\node_modules.registry.npmjs.org\umi\1.3.18\node_modules\umi\lib\generators\page.js:56:38)
at _default (C:\Users\aa\AppData\Roaming\npm\pnpm-global\1\node_modules.registry.npmjs.org\umi\1.3.18\node_modules\umi\lib\generate.js:27:19)
at Object. (C:\Users\aa\AppData\Roaming\npm\pnpm-global\1\node_modules.registry.npmjs.org\umi\1.3.18\node_modules\umi\lib\scripts\generate.js:23:23)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)

Most helpful comment

umi 需要 2.x 才可以。

All 3 comments

umi 需要 2.x 才可以。

我卸载了
pnpm uninstall umi

pnpm install umi@next
然后安装的 是 2.x

然后我
pnpm umi g page index

生成了一个页面

然后运行
pnpm umi dev

后报错。

ERROR Failed to compile with 1 errors 15:22:07

This dependency was not found:

To install it, you can run: npm install --save E:/work_front2/myapp_umi_start/node_modules/.registry.npmjs.org/umi-build-dev/1.0.0-beta.17/@babel![email protected]/node_modules/umi-build-dev/lib/plugins
/404/NotFound.js

而且我已经 用 pnpm 安装了 。

E:\work_front2\myapp_umi_start>pnpm install --save
Performing headless installation
Already up-to-date
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/@babel/core
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/@babel/register
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/@babel/preset-env
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/acorn-globals
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/af-webpack
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/antd
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/awesome-typescript-loader
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/babel-eslint
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/babel-loader
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/babel-register
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/babel-template
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/babel-traverse
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/bonjour
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/cacache
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/caniuse-api
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/copy-concurrently
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/cosmiconfig
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/cpx
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/create-hash
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/create-hmac
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/create-react-class
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/cross-spawn
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/css-selector-tokenizer
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/cssnano
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/del
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/diffie-hellman
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/eslint
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/eslint-config-react-app
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/eslint-loader
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/eslint-plugin-flowtype
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/eslint-plugin-import
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/eslint-plugin-jsx-a11y
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/eslint-plugin-react
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/espree
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/extract-text-webpack-plugin
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/fbjs
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/find-babel-config
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/flat-cache
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/fork-ts-checker-webpack-plugin
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/global-prefix
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/handlebars
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/hard-source-webpack-plugin
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/history
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/html-minifier
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/html-webpack-plugin
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/http-signature
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/invariant
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/istanbul-api
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/istanbul-lib-instrument
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/istanbul-lib-report
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/istanbul-lib-source-maps
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/istanbul-reports
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/jest-cli
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/jest-haste-map
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/jest-runner
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/jest-runtime
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/jest-snapshot
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/jest-util
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/js-yaml
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/jsdom
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/karma-chrome-launcher
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/less
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/less-loader
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/loader-fs-cache
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/loader-utils
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/memory-fs
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/move-concurrently
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/nearley
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/node-notifier
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/normalize-package-data
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/package-json
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/pbkdf2
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/portfinder
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/postcss-merge-rules
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/postcss-svgo
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/progress-bar-webpack-plugin
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/prop-types
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/rc-cascader
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/rc-tree-select
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/rc-upload
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/react
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/react-dev-utils
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/react-dom
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/react-reconciler
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/react-router
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/react-router-dom
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/redent
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/regexpu-core
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/registry-auth-token
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/registry-url
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/regjsparser
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/request
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/rst-selector-parser
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/sane
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/semver-diff
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/sockjs
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/source-map-resolve
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/sw-precache
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/svgo
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/sw-precache-webpack-plugin
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/ts-jest-babel-7
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/tslint
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/tslint-loader
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/tsutils
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/uglifyjs-webpack-plugin
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/umi-history
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/umi-test
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/update-notifier
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/url-loader
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/warning
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/webpack
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/webpack-bundle-analyzer
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/webpack-dev-middleware
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/webpack-dev-server
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/webpack-manifest-plugin
 WARN  There's a directory in node_modules without package.json: E:/work_front2/myapp_umi_start/node_modules/write

E:\work_front2\myapp_umi_start>pnpm install --save

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sorrycc picture sorrycc  ·  4Comments

liuxinqiong picture liuxinqiong  ·  3Comments

sorrycc picture sorrycc  ·  4Comments

nguyenhuutinh picture nguyenhuutinh  ·  3Comments

afc163 picture afc163  ·  3Comments