nodeca / pica

Resize image in browser with high quality and high speed

Home Page:http://nodeca.github.io/pica/demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm start failured when use pica

WilliamCheen opened this issue · comments

I use the latest pica on macOS 10.15.4,there always some error when I start with 'npm start' command. However,the project can run successfully on Windows 10. I'm a newbie and I don't know how to solve this problem,can you help me?
`✖ Webpack
Compiled with some errors in 7.59s

ERROR Failed to compile with 4 errors 上午11:50:46

error in ./node_modules/multimath/lib/unsharp_mask/unsharp_mask.wasm

Import "memory" from "env" with Memory can only be used for direct wasm to wasm dependencies

error in ./node_modules/pica/lib/mm_resize/convolve.wasm

Import "memory" from "env" with Memory can only be used for direct wasm to wasm dependencies

error in ./node_modules/multimath/lib/unsharp_mask/unsharp_mask.wasm

WebAssembly module is included in initial chunk.
This is not allowed, because WebAssembly download and compilation must happen asynchronous.
Add an async splitpoint (i. e. import()) somewhere between your entrypoint and the WebAssembly module:

  • dll umi --> ./node_modules/pica/index.js --> ./node_modules/pica/lib/mathlib.js --> ./node_modules/multimath/lib/unsharp_mask/index.js --> ./node_modules/multimath/lib/unsharp_mask/unsharp_mask.wasm
  • ... --> ./node_modules/pica/index.js --> ./node_modules/pica/lib/worker.js --> ./node_modules/pica/lib/mathlib.js --> ./node_modules/multimath/lib/unsharp_mask/index.js --> ./node_modules/multimath/lib/unsharp_mask/unsharp_
    mask.wasm

error in ./node_modules/pica/lib/mm_resize/convolve.wasm

WebAssembly module is included in initial chunk.
This is not allowed, because WebAssembly download and compilation must happen asynchronous.
Add an async splitpoint (i. e. import()) somewhere between your entrypoint and the WebAssembly module:

  • dll umi --> ./node_modules/pica/index.js --> ./node_modules/pica/lib/mathlib.js --> ./node_modules/pica/lib/mm_resize/index.js --> ./node_modules/pica/lib/mm_resize/resize.js --> ./node_modules/pica/lib/mm_resize/convolve.w
    asm
  • ... --> ./node_modules/pica/index.js --> ./node_modules/pica/lib/worker.js --> ./node_modules/pica/lib/mathlib.js --> ./node_modules/pica/lib/mm_resize/index.js --> ./node_modules/pica/lib/mm_resize/resize.js --> ./node_mod
    ules/pica/lib/mm_resize/convolve.wasm

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ant-design-pro@2.0.0 start: cross-env APP_TYPE=site umi dev
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ant-design-pro@2.0.0 start 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! /Users/hiwill/.npm/_logs/2020-04-26T03_50_46_129Z-debug.log`

Here's the log.

0 info it worked if it ends with ok 1 verbose cli [ 1 verbose cli '/usr/local/Cellar/node/13.12.0/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'start' 1 verbose cli ] 2 info using npm@6.14.4 3 info using node@v13.12.0 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle ant-design-pro@2.0.0~prestart: ant-design-pro@2.0.0 6 info lifecycle ant-design-pro@2.0.0~start: ant-design-pro@2.0.0 7 verbose lifecycle ant-design-pro@2.0.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle ant-design-pro@2.0.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/hiwill/Projects/HuaYiMedical/HuaYiWeb/institution/node_modules/.bin:/usr/local/opt/node@10/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Apple/usr/bin:/usr/local/opt/node@10/bin 9 verbose lifecycle ant-design-pro@2.0.0~start: CWD: /Users/hiwill/Projects/HuaYiMedical/HuaYiWeb/institution 10 silly lifecycle ant-design-pro@2.0.0~start: Args: [ '-c', 'cross-env APP_TYPE=site umi dev' ] 11 silly lifecycle ant-design-pro@2.0.0~start: Returned: code: 1 signal: null 12 info lifecycle ant-design-pro@2.0.0~start: Failed to exec start script 13 verbose stack Error: ant-design-pro@2.0.0 start: cross-env APP_TYPE=site umi dev13 verbose stack Exit status 1 13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16) 13 verbose stack at EventEmitter.emit (events.js:315:20) 13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:315:20) 13 verbose stack at maybeClose (internal/child_process.js:1026:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) 14 verbose pkgid ant-design-pro@2.0.0 15 verbose cwd /Users/hiwill/Projects/HuaYiMedical/HuaYiWeb/institution 16 verbose Darwin 19.4.0 17 verbose argv "/usr/local/Cellar/node/13.12.0/bin/node" "/usr/local/bin/npm" "start" 18 verbose node v13.12.0 19 verbose npm v6.14.4 20 error code ELIFECYCLE 21 error errno 1 22 error ant-design-pro@2.0.0 start:cross-env APP_TYPE=site umi dev 22 error Exit status 1 23 error Failed at the ant-design-pro@2.0.0 start script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]