Closed 17601330731 closed 3 years ago
@17601330731
忽略 cypress
试试
$ CYPRESS_INSTALL_BINARY=0 npm i
安装也报错了
D:\Webstorm2018\imove>npm install npm WARN deprecated fsevents@2.1.3: "Please update to latest v2.3 or v2.2" npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
cypress@6.5.0 postinstall D:\Webstorm2018\imove\node_modules\cypress node index.js --exec install
D:\Webstorm2018\imove\node_modules\fs-extra\lib\mkdirs\make-dir.js:85 } catch { ^
SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
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)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cypress@6.5.0 postinstall: node index.js --exec install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cypress@6.5.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2021-02-25T06_04_37_535Z-debug.log
@skyer83 看着像是 cypress
安装完之后报错了,你用 CYPRESS_INSTALL_BINARY=0 npm i
的方式忽略掉 cypress
,或者先在 package.json
中把 cypress
删除再 npm install
试试
在 package.json 去掉 cypress 后再 install ,cypress 的错误是过了,但又抛了另一个错误
D:\Webstorm2018\imove>npm install npm WARN deprecated fsevents@2.1.3: "Please update to latest v2.3 or v2.2" npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
root@ postinstall D:\Webstorm2018\imove lerna init && lerna bootstrap && npm link packages/cli
lerna notice cli v3.22.1 lerna info Updating package.json lerna info Updating lerna.json lerna info Creating packages directory lerna success Initialized Lerna files lerna notice cli v3.22.1 lerna info Bootstrapping 5 packages lerna info Installing external dependencies lerna ERR! npm install exited 1 in '@imove/json-schema-editor' lerna ERR! npm install stderr: npm WARN @imove/json-schema-editor@0.3.2 requires a peer of react-dom@^16.13.1 but none is installed. You must install peer dependencies yourself.
npm ERR! code ETARGET npm ERR! notarget No matching version found for @emotion/styled-base@10.0.31 npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist. npm ERR! notarget npm ERR! notarget It was specified as a dependency of '@imove/json-schema-editor' npm ERR! notarget
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2021-02-25T08_41_28_916Z-debug.log
lerna ERR! npm install exited 1 in '@imove/json-schema-editor'
lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! root@ postinstall: lerna init && lerna bootstrap && npm link packages/cli
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the root@ postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2021-02-25T08_41_44_230Z-debug.log
@skyer83
@imove/json-schema-editor
这个包用不到,我们会删掉,不过这个包安装失败应该不影响你项目运行,你可以再 npm start
试试能不能启动。
@SmallStoneSK D:\Webstorm2018\imove>npm start
root@ start D:\Webstorm2018\imove concurrently "lerna run watch --parallel" "cross-env APP_ROOT=example umi dev"
[0] lerna notice cli v3.22.1
[0] lerna info Executing command in 4 packages: "npm run watch"
[0] @imove/plugin-store: ┌────────────────────────────────────────────────────────────────────┐
[0] @imove/plugin-store: │ npm update check failed │
[0] @imove/plugin-store: │ Try running with sudo or get access │
[0] @imove/plugin-store: │ to the local update config store via │
[0] @imove/plugin-store: │ sudo chown -R $USER:$(id -gn $USER) C:\Users\Administrator.config │
[0] @imove/plugin-store: └────────────────────────────────────────────────────────────────────┘
[0] @imove/core: > @imove/core@0.3.8 watch D:\Webstorm2018\imove\packages\core
[0] @imove/core: > watch "npm run build" ./src
[0] @imove/json-schema-editor: > @imove/json-schema-editor@0.3.2 watch D:\Webstorm2018\imove\packages\json-schema-editor
[0] @imove/json-schema-editor: > watch "npm run build" ./src
[0] @imove/compile-code: > @imove/compile-code@0.1.0 watch D:\Webstorm2018\imove\packages\compile-code
[0] @imove/compile-code: > watch "npm run build" ./src
[0] @imove/plugin-store: > @imove/plugin-store@0.0.3 watch D:\Webstorm2018\imove\packages\plugin-store
[0] @imove/plugin-store: > watch "npm run build" ./src
[0] @imove/json-schema-editor: > Watching ./src
[0] @imove/compile-code: > Watching ./src
[0] @imove/core: > Watching ./src
[1] Starting the development server...
[0] @imove/plugin-store: > Watching ./src
[1] Unexpected reserved word
[1] D:\Webstorm2018\imove\node_modules\prettier\third-party.js:9863
[1] for await (const place of this.config.searchPlaces) {
[1] ^^^^^
[1]
[1] SyntaxError: Unexpected reserved word
[1] at createScript (vm.js:80:10)
[1] at Object.runInThisContext (vm.js:139:10)
[1] at Module._compile (module.js:616:28)
[1] at Module._compile (D:\Webstorm2018\imove\node_modules\pirates\lib\index.js:99:24)
[1] at Module._extensions..js (module.js:663:10)
[1] at Object.newLoader [as .js] (D:\Webstorm2018\imove\node_modules\pirates\lib\index.js:104:7)
[1] at Module.load (module.js:565:32)
[1] at tryModuleLoad (module.js:505:12)
[1] at Function.Module._load (module.js:497:3)
[1] at Module.require (module.js:596:17)
[1] cross-env APP_ROOT=example umi dev exited with code 0
[0] @imove/core: > @imove/core@0.3.8 build D:\Webstorm2018\imove\packages\core
[0] @imove/core: > rollup -c & npm run declare-type
[0] @imove/json-schema-editor: > @imove/json-schema-editor@0.3.2 build D:\Webstorm2018\imove\packages\json-schema-editor
[0] @imove/json-schema-editor: > rollup -c & npm run declare-type
[0] @imove/compile-code: > @imove/compile-code@0.1.0 build D:\Webstorm2018\imove\packages\compile-code
[0] @imove/compile-code: > rollup -c & npm run declare-type
[0] @imove/plugin-store: > @imove/plugin-store@0.0.3 build D:\Webstorm2018\imove\packages\plugin-store
[0] @imove/plugin-store: > rollup -c & npm run declare-type
[0] @imove/compile-code: D:\Webstorm2018\imove\node_modules\rollup\dist\shared\loadConfigFile.js:480
[0] @imove/compile-code: ? (await import(url.pathToFileURL(fileName).href)).default
[0] @imove/compile-code: ^^^^^^
[0] @imove/compile-code: SyntaxError: Unexpected token import
[0] @imove/compile-code: at createScript (vm.js:80:10)
[0] @imove/compile-code: at Object.runInThisContext (vm.js:139:10)
[0] @imove/compile-code: at Module._compile (module.js:616:28)
[0] @imove/compile-code: at Object.Module._extensions..js (module.js:663:10)
[0] @imove/compile-code: at Module.load (module.js:565:32)
[0] @imove/compile-code: at tryModuleLoad (module.js:505:12)
[0] @imove/compile-code: at Function.Module._load (module.js:497:3)
[0] @imove/compile-code: at Module.require (module.js:596:17)
[0] @imove/compile-code: at require (internal/module.js:11:18)
[0] @imove/compile-code: at Object.tsc --emitDeclarationOnly
[0] @imove/json-schema-editor: npm ERR! Exit status 1
[0] @imove/json-schema-editor: npm ERR!
[0] @imove/json-schema-editor: npm ERR! Failed at the @imove/json-schema-editor@0.3.2 declare-type script.
[0] @imove/json-schema-editor: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[0] @imove/json-schema-editor: ┌────────────────────────────────────────────────────────────────────┐
[0] @imove/json-schema-editor: │ npm update check failed │
[0] @imove/json-schema-editor: │ Try running with sudo or get access │
[0] @imove/json-schema-editor: │ to the local update config store via │
[0] @imove/json-schema-editor: │ sudo chown -R $USER:$(id -gn $USER) C:\Users\Administrator.config │
[0] @imove/json-schema-editor: └────────────────────────────────────────────────────────────────────┘
[0] @imove/json-schema-editor: npm ERR! A complete log of this run can be found in:
[0] @imove/json-schema-editor: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2021-02-25T09_19_04_404Z-debug.log
[0] @imove/json-schema-editor: npm ERR! code ELIFECYCLE
[0] @imove/json-schema-editor: npm ERR! errno 1
[0] @imove/json-schema-editor: npm ERR! @imove/json-schema-editor@0.3.2 build: rollup -c & npm run declare-type
[0] @imove/json-schema-editor: npm ERR! Exit status 1
[0] @imove/json-schema-editor: npm ERR!
[0] @imove/json-schema-editor: npm ERR! Failed at the @imove/json-schema-editor@0.3.2 build script.
[0] @imove/json-schema-editor: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[0] @imove/json-schema-editor: npm ERR! A complete log of this run can be found in:
[0] @imove/json-schema-editor: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2021-02-25T09_19_04_513Z-debug.log
[0] @imove/core: src/components/codeRun/index.tsx(16,34): error TS2307: Cannot find module '@imove/compile-code' or its corresponding type declarations.
[0] @imove/core: src/mods/header/export/exportModal.tsx(9,35): error TS2307: Cannot find module '@imove/compile-code' or its corresponding type declarations.
[0] @imove/core: npm ERR! code ELIFECYCLE
[0] @imove/core: npm ERR! errno 2
[0] @imove/core: npm ERR! @imove/core@0.3.8 declare-type: tsc --emitDeclarationOnly
[0] @imove/core: npm ERR! Exit status 2
[0] @imove/core: npm ERR!
[0] @imove/core: npm ERR! Failed at the @imove/core@0.3.8 declare-type script.
[0] @imove/core: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[0] @imove/core: npm ERR! A complete log of this run can be found in:
[0] @imove/core: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2021-02-25T09_19_09_088Z-debug.log
[0] @imove/core: npm ERR! code ELIFECYCLE
[0] @imove/core: npm ERR! errno 2
[0] @imove/core: npm ERR! @imove/core@0.3.8 build: rollup -c & npm run declare-type
[0] @imove/core: npm ERR! Exit status 2
[0] @imove/core: npm ERR!
[0] @imove/core: npm ERR! Failed at the @imove/core@0.3.8 build script.
[0] @imove/core: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[0] @imove/core: npm ERR! A complete log of this run can be found in:
[0] @imove/core: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2021-02-25T09_19_09_117Z-debug.log
启失败了
@skyer83
你这个报错应该是各个包之间没有 link
。
你先把 packages/json-schema-editor
这个删掉,然后在根目录下执行 lerna bootstrap
后再启动试试
@SmallStoneSK
packages/json-schema-editor 目录去掉了,lerna bootstrap 也执行了(之前没安装,先执行了:npm install --global lerna)
D:\Webstorm2018\imove>lerna bootstrap info cli using local version of lerna lerna notice cli v3.22.1 lerna info Bootstrapping 4 packages lerna info Symlinking packages and binaries lerna WARN EREPLACE_EXIST @imove/compile-code is already installed for @imove/cli. Replacing with symlink... lerna success Bootstrapped 4 packages
D:\Webstorm2018\imove>npm start
root@ start D:\Webstorm2018\imove concurrently "lerna run watch --parallel" "cross-env APP_ROOT=example umi dev"
[0] lerna notice cli v3.22.1
[0] lerna info Executing command in 3 packages: "npm run watch"
[0] @imove/core: > @imove/core@0.3.8 watch D:\Webstorm2018\imove\packages\core
[0] @imove/core: > watch "npm run build" ./src
[0] @imove/plugin-store: > @imove/plugin-store@0.0.3 watch D:\Webstorm2018\imove\packages\plugin-store
[0] @imove/plugin-store: > watch "npm run build" ./src
[0] @imove/compile-code: > @imove/compile-code@0.1.0 watch D:\Webstorm2018\imove\packages\compile-code
[0] @imove/compile-code: > watch "npm run build" ./src
[1] Starting the development server...
[0] @imove/plugin-store: > Watching ./src
[0] @imove/compile-code: > Watching ./src
[0] @imove/core: > Watching ./src
[1] Unexpected reserved word
[1] D:\Webstorm2018\imove\node_modules\prettier\third-party.js:9863
[1] for await (const place of this.config.searchPlaces) {
[1] ^^^^^
[1]
[1] SyntaxError: Unexpected reserved word
[1] at createScript (vm.js:80:10)
[1] at Object.runInThisContext (vm.js:139:10)
[1] at Module._compile (module.js:616:28)
[1] at Module._compile (D:\Webstorm2018\imove\node_modules\pirates\lib\index.js:99:24)
[1] at Module._extensions..js (module.js:663:10)
[1] at Object.newLoader [as .js] (D:\Webstorm2018\imove\node_modules\pirates\lib\index.js:104:7)
[1] at Module.load (module.js:565:32)
[1] at tryModuleLoad (module.js:505:12)
[1] at Function.Module._load (module.js:497:3)
[1] at Module.require (module.js:596:17)
[1] cross-env APP_ROOT=example umi dev exited with code 0
[0] @imove/plugin-store: > @imove/plugin-store@0.0.3 build D:\Webstorm2018\imove\packages\plugin-store
[0] @imove/plugin-store: > rollup -c & npm run declare-type
[0] @imove/core: > @imove/core@0.3.8 build D:\Webstorm2018\imove\packages\core
[0] @imove/core: > rollup -c & npm run declare-type
[0] @imove/compile-code: > @imove/compile-code@0.1.0 build D:\Webstorm2018\imove\packages\compile-code
[0] @imove/compile-code: > rollup -c & npm run declare-type
[0] @imove/plugin-store: D:\Webstorm2018\imove\node_modules\rollup\dist\shared\loadConfigFile.js:480
[0] @imove/plugin-store: ? (await import(url.pathToFileURL(fileName).href)).default
[0] @imove/plugin-store: ^^^^^^
[0] @imove/plugin-store: SyntaxError: Unexpected token import
[0] @imove/plugin-store: at createScript (vm.js:80:10)
[0] @imove/plugin-store: at Object.runInThisContext (vm.js:139:10)
[0] @imove/plugin-store: at Module._compile (module.js:616:28)
[0] @imove/plugin-store: at Object.Module._extensions..js (module.js:663:10)
[0] @imove/plugin-store: at Module.load (module.js:565:32)
[0] @imove/plugin-store: at tryModuleLoad (module.js:505:12)
[0] @imove/plugin-store: at Function.Module._load (module.js:497:3)
[0] @imove/plugin-store: at Module.require (module.js:596:17)
[0] @imove/plugin-store: at require (internal/module.js:11:18)
[0] @imove/plugin-store: at Object.
@skyer83
你的 node
版本是多少?
看报错是 rollup
解析不了 import
,在 rollup
的 issue
区找到这个:https://github.com/rollup/rollup/issues/3594#issuecomment-633682616
报错信息和你的类似,你升级下 node
版本试试,不能低于 10
这样,我的 node 版本是 v8.11.2 ,看来是太低了
@SmallStoneSK 谢谢!
npm ERR! code 1 npm ERR! path C:\Users\EDZ\Desktop\imove\imove\node_modules\cypress npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node index.js --exec install npm ERR! internal/modules/cjs/loader.js:883 npm ERR! throw err; npm ERR! ^ npm ERR! npm ERR! Error: Cannot find module 'minimist' npm ERR! Require stack: npm ERR! - C:\Users\EDZ\Desktop\imove\imove\node_modules\cypress\index.js npm ERR! at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:725:27) npm ERR! at Module.require (internal/modules/cjs/loader.js:952:19) npm ERR! at require (internal/modules/cjs/helpers.js:88:18) npm ERR! at Object. (C:\Users\EDZ\Desktop\imove\imove\node_modules\cypress\index.js:3:18)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:1063:30)
npm ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
npm ERR! at Module.load (internal/modules/cjs/loader.js:928:32)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:769:14)
npm ERR! at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
npm ERR! code: 'MODULE_NOT_FOUND',
npm ERR! requireStack: [
npm ERR! 'C:\Users\EDZ\Desktop\imove\imove\node_modules\cypress\index.js'
npm ERR! ]
npm ERR! }
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\EDZ\AppData\Local\npm-cache_logs\2021-02-24T03_41_18_171Z-debug.log