Sharp: How to install Sharp on angular 2 ?

Created on 7 Sep 2017  Â·  1Comment  Â·  Source: lovell/sharp

When i run the server appear this error:

`

WARNING in ./~/sharp/lib/icc/sRGB.icc
Module parse failed: C:\Users\Work\Desktop\AngularNodeTest\new\DoodlyAccounts\node_modules\sharp\lib\icc\sRGB.icc Unexpected character ' ' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
 @ ./~/sharp/lib ^\.\/.*$
 @ ./~/sharp/lib/index.js
 @ ./src/app/app.component.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://accounts.doodly.com:81 ./src/main.ts

WARNING in ./~/sharp/lib/icc/cmyk.icm
Module parse failed: C:\Users\Work\Desktop\AngularNodeTest\new\DoodlyAccounts\node_modules\sharp\lib\icc\cmyk.icm Unexpected character ' ' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
 @ ./~/sharp/lib ^\.\/.*$
 @ ./~/sharp/lib/index.js
 @ ./src/app/app.component.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://accounts.doodly.com:81 ./src/main.ts

WARNING in ./~/sharp/lib/constructor.js
Module not found: Error: Can't resolve '../vendor/lib/versions.json' in 'C:\Users\Work\Desktop\AngularNodeTest\new\DoodlyAccounts\node_modules\sharp\lib'
 @ ./~/sharp/lib/constructor.js 24:15-53
 @ ./~/sharp/lib/index.js
 @ ./src/app/app.component.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://accounts.doodly.com:81 ./src/main.ts

ERROR in C:/Users/Work/Desktop/AngularNodeTest/new/DoodlyAccounts/src/app/app.component.ts (28,1): Cannot find name 'readableStream'.

ERROR in C:/Users/Work/Desktop/AngularNodeTest/new/DoodlyAccounts/src/app/app.component.ts (30,9): Cannot find name 'writableStream'.

ERROR in C:/Users/Work/Desktop/AngularNodeTest/new/DoodlyAccounts/src/app/app.component.ts (28,1): Cannot find name 'readableStream'.

ERROR in C:/Users/Work/Desktop/AngularNodeTest/new/DoodlyAccounts/src/app/app.component.ts (30,9): Cannot find name 'writableStream'.

ERROR in ./~/sharp/build/Release/sharp.node
Module parse failed: C:\Users\Work\Desktop\AngularNodeTest\new\DoodlyAccounts\node_modules\sharp\build\Release\sharp.node Unexpected character '�' (1:2)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
 @ ./~/sharp/lib/constructor.js 9:14-52
 @ ./~/sharp/lib/index.js
 @ ./src/app/app.component.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://accounts.doodly.com:81 ./src/main.ts
webpack: Failed to compile.

`

how can I solve this problem ?

question

Most helpful comment

sharp is a server side node module. You're trying to load it using a webpack loader?
Afaik it's not possible because sharp requires many native modules to work.

>All comments

sharp is a server side node module. You're trying to load it using a webpack loader?
Afaik it's not possible because sharp requires many native modules to work.

Was this page helpful?
0 / 5 - 0 ratings