Something went wrong installing the "sharp" module - reactjs

I already do what the error said. I removed the sharp then npm install --ignore-scripts=false --verbose but it still doesn't work.
I also tried the:
rimraf node_modules
rimraf yarn.lock
yarn
What might the problem here?
npm: 6.13.4
node: v10.18.0
python: 3.7.0
sharp: ^0.26.2
windows 10 pro 64-bit
! Error:
Something went wrong installing the "sharp" module
\\?\C:\Users\ph2200009\Desktop\TM\cplus_incident_mgnt\functions\node_modules\sharp\build\Release\sharp.node is not a valid Win32 application.
\\?\C:\Users\ph2200009\Desktop\TM\cplus_incident_mgnt\functions\node_modules\sharp\build\Release\sharp.node
- Remove the "node_modules/sharp" directory then run
"npm install --ignore-scripts=false --verbose" and look for errors
at Object.<anonymous> (C:\Users\ph2200009\Desktop\TM\cplus_incident_mgnt\functions\node_modules\sharp\lib\constructor.js:34:9)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Users\ph2200009\Desktop\TM\cplus_incident_mgnt\functions\node_modules\sharp\lib\index.js:3:15)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Users\ph2200009\Desktop\TM\cplus_incident_mgnt\functions\helpers\image.js:1:15)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
! We were unable to load your functions code. (see above)

If you have an Apple M1 chip, try the following:
brew install vips
npm rebuild --verbose sharp

I used this rebuild command to fix it:
npm rebuild --verbose sharp

Try to remove the node_modules folder by typing rm -rf node_modules in terminal and then type npm i and after that try to install sharp again by npm i sharp

Related

Error when display a version of react-native

When I check a version of react-native the error outputting like this:
react-native -v
fs.js:114
throw err;
^
Error: EPERM: operation not permitted, chmod '/usr/local/lib/node_modules/react-native/node_modules/#react-native-community/cli/build/commands/server/external/xsel'
at Object.chmodSync (fs.js:1027:3)
at Object.<anonymous> (/usr/local/lib/node_modules/react-native/node_modules/#react-native-community/cli/build/commands/server/copyToClipBoard.js:50:15)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/usr/local/lib/node_modules/react-native/node_modules/#react-native-community/cli/build/commands/server/middleware/copyToClipBoardMiddleware.js:8:47)
You have a permission error it seems ¯_(ツ)_/¯
or
Now clean the project...
cd android
gradlew clean

After running yarn eject on create-react-app throw new ERR_INVALID_ARG_TYPE('path', 'string', path);

After running yarn eject on create-react-app when I try to run yarn start the terminal shows error something like this:
$ node scripts/start.js
path.js:39
throw new ERR_INVALID_ARG_TYPE('path', 'string', path);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. R
eceived type undefined
at assertPath (path.js:39:11)
at Object.resolve (path.js:168:7)
at Object.<anonymous> (C:\projects\aditya-portfolio\config\webpack.config.d
ev.js:193:39)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (C:\projects\aditya-portfolio\scripts\start.js:31:16)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this com
mand.
I was trying to config SCSS in webpack config file but after doing the config when I try to run yarn start it always fails with the above error. How can I fix this?

The "#angular/compiler-cli" package was not properly installed. Error: Cannot find module '#angular/compiler-cli'

When trying npm start or ng serve it shows the error like this :
The "#angular/compiler-cli" package was not properly installed. Error: Error: Cannot find module '#angular/compiler-cli'
Error: The "#angular/compiler-cli" package was not properly installed. Error: Error: Cannot find module '#angular/compiler-cli'
at Object. (/home/jsnsree/.nvm/versions/node/v6.11.2/lib/node_modules/#angular/cli/node_modules//src/index.js:14:11)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/home/jsnsree/.nvm/versions/node/v6.11.2/lib/node_modules/#angular/cli/tasks/eject.js:10:19)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
And the ng versoin in my application shows :
#angular/cli: 1.3.2
node: 6.11.2
os: linux x64
#angular/animations: error
#angular/common: error
#angular/compiler: error
#angular/core: error
#angular/forms: error
#angular/http: error
#angular/platform-browser: error
#angular/platform-browser-dynamic: error
#angular/platform-server: error
#angular/router: error
#angular/cli: error
#angular/compiler-cli: error
I tried to remove and reinstall angular/cli but it doesn't make any changes:
Try re-installing your CLI.
npm uninstall -g #angular/cli
npm cache clean
npm install -g #angular/cli#latest
delete node_modules from your project
and run
npm install
this will work
Try this command:
npm install #angular/{animations,common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router}

Mean Stack application module.js:471 throw err; ^

Getting Following error message,I tried to fix by updating npm and reinstall of mean stack application by running npm install
Error: Cannot find module 'npm'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous>
(C:\Users\Laptop2\AppData\Roaming\npm\node_modules\mean-cli\lib\cli.js:5:7)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
Update Npm by using following command issue resolve
npm install npm#latest -g
Try:
npm install npm#latest -g

Getting an error when using babel to convert react jsx code

I am trying to convert my jsx code to js using babel.
babel --presets es2015,react --minified finan.js -o ./compiled/compiled.js
Error: Cannot find module 'js-tokens'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (C:\Users\Saurav\Desktop\newcode dev\untitled4\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-function-name\node_modules\babel-hel
per-function-name\node_modules\babel-traverse\node_modules\babel-code-frame\lib\index.js:50:41)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
Recently i faced the same error . Just use :
npm update
or delete babel-preset-es2015 from node_modules folder and reinstall it using
npm install

Resources