2017-12-13 15 views
0

こんにちは私は誰もがこのNodejsは、「シャープ」モジュールでエラーを表現

Technical error has occured. 
Error: Cannot find module 'sharp' 
at Function.Module._resolveFilename (module.js:536:15) 
at Function.Module._load (module.js:466:25) 
at Module.require (module.js:579:17) 
at require (internal/module.js:11:18) 
at Object.<anonymous> (C:\wamp64\www\MyProject\app\helpers\ima 
geUploadHelper.js:8:13) 
at Module._compile (module.js:635:30) 
at Object.Module._extensions..js (module.js:646:10) 
at Module.load (module.js:554:32) 
at tryModuleLoad (module.js:497:12) 
at Function.Module._load (module.js:489:3) 
at Module.require (module.js:579:17) 
at require (internal/module.js:11:18) 
at updateprofileImage (C:\wamp64\www\MyProject\controllers 
\userController.js:421:29) 
at <anonymous> 
at process._tickCallback (internal/process/next_tick.js:188:7) 

のためのソリューションを持っている場合、返信してください以下のようなnodejsでエラーを得た私は、このエラーが原因でシャープなモジュールのだと思ったので、私は実行プロジェクトにシャープなモジュールを追加するには、 'npm install sharp'を選択します。しかし、私は以下のようなエラーが表示されます

[email protected] install C:\wamp64\www\MyProject\node_modules\sharp 
node-gyp rebuild 


C:\wamp64\www\MyProject\node_modules\sharp>if not defined npm_conf 
ig_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp- 
bin\\.. 
\..\node_modules\node-gyp\bin\node-gyp.js" rebuild) else (node "" rebuild 
) 
Building the projects in this solution one at a time. To enable parallel 
build, 
please add the "/m" switch. 
C:\wamp64\www\MyProject\node_modules\sharp\build\libvips-cpp.vcxp 
roj(20,3): error MSB4019: The imported project 
"C:\Microsoft.Cpp.Default.props" 
was not found. Confirm that the path in the <Import> declaration is correct, 
and that the file exists on disk. 
gyp ERR! build error 
gyp ERR! stack Error: 
`C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe 
` failed with exit code: 1 
gyp ERR! stack  at ChildProcess.onExit (C:\Program 
Files\nodejs\node_modules\ 
npm\node_modules\node-gyp\lib\build.js:258:23) 
gyp ERR! stack  at emitTwo (events.js:126:13) 
gyp ERR! stack  at ChildProcess.emit (events.js:214:7) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit 
(internal/child_process.js:198:12) 
gyp ERR! System Windows_NT 6.3.9600 
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program 
Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" 
"rebuild" 
gyp ERR! cwd C:\wamp64\www\MyProject\node_modules\sharp 
gyp ERR! node -v v8.9.1 
gyp ERR! node-gyp -v v3.6.2 
gyp ERR! not ok 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] 
(node_modules\fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
[email protected]: wanted {"os":"darwin","arch":"any"} (current: 
{"os":"win32","arch":"x64"}) 

npm ERR! code ELIFECYCLE 
npm ERR! errno 1 
npm ERR! [email protected] install: `node-gyp rebuild` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] install 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\roby.jacob\AppData\Roaming\npm-cache\_logs\2017-12- 
13T09_59_04_884Z-debug.log 

誰かが同じ状況に遭遇して解消した場合は、返信してください。

答えて

0

現在地より良いドキュメントを読んでする必要があります:NPMインストールが実行される前に

http://sharp.dimens.io/en/stable/install/

libvipsをインストールする必要があります。

これは、Windows上でlibvipsをインストールするのに役立ちます:

https://jcupitt.github.io/libvips/install.html

+0

こんにちは、roby.elan @ノードプロジェクト –

+0

の急激なモジュールのインストールに必要なlibvipsある - はい、これは私がlibvipsをインストールする場合 –

+0

あり、それは仕事をしなかった...どのようにあなたは同じをインストールしましたか?私が間違っている場合に備えて、ちょうど知りたい。 –

関連する問題