I am trying to setup a react project. It has lot of dependencies and while downloading one of module it is throwing this error. This is on windows.
pngquant failed to build, make sure that libpng-dev is installed
Output:
‼ unable to get local issuer certificate
pngquant pre-build test failed
compiling from source
pngquant pre-build test passed successfully
Error: pngquant failed to build, make sure that libpng-dev is installed
You didn't installed lib-png so that error is coming.Try to install lib-png first.
sudo apt-get install libpng-dev
npm install -g pngquant-bin
To expound more on #Mukesh's answer.
I experienced this issue when building a react project that uses the imagemin-pngquant package.
When I run npm install on the server I get the below error:
pngquant pre-build test failed
compiling from source
pngquant pre-build test passed successfully
Error: pngquant failed to build, make sure that libpng-dev is installed
Here's how I fixed it:
Install libpng-dev package on your machine/server:
sudo apt-get install libpng-dev
Add pngquant-bin package to your npm packages in the package.json file (if it doesn't yet exist):
"dependencies": {
.
.
.
"imagemin-pngquant": "^9.0.1",
.
.
.
}
OR
Run the command to install the pngquant-bin package:
npm install imagemin-pngquant --save // to install the latest
OR
npm install imagemin-pngquant#9.0.1 --save // to install a specific version
Note: You can try npm install imagemin-pngquant#5.0.1 --save if you encounter issues with the latest version.
Now everything should be fine if you install the npm packages and build the project again using:
npm install
npm run build
That's all.
I hope this helps
On Ubuntu you can try to fix it with apt-get install -y libpango1.0-dev command, worked for older node v6
I faced the same issue:
Solution
Step 1
sudo apt-get update -y
Step 2
sudo apt-get install -y libpng-dev
These two steps sorted out my issue and working fine.
This worked for me on Windows:
Run Windows PowerShell as Admin
npm install --global --production windows-build-tools
If you have made any previous npm installation attempt which you most likely had, clean everything and then do a fresh dependency installation:
rm node_modules -R
rm package-lock.json
npm install
Good luck!
Related
I'm creating a laravel application with react template, when I run npm install
throws an error exception, I also tried changing folder permissions, removed
node_modules then reinstalled it but not working any solutions???
Judging by the error I see in your console:
pngquant failed to build, make sure that libpng-dev is installed
Seems like you don't have a pngquant package installed. Try the following steps:
Install package locally:
sudo apt-get install libpng-dev
Install npm package:
npm install -g pngquant-bin
If you already have node_modules directory in your project, delete it and install node_modules again:
npm install
According to Image Provided, Everything seems to be fine until it hits this missing package causing the exception to be thrown.
The missing package is libpng-dev: A virtual package.
See the Debian policy for a definition of virtual packages.
You can see here for details.
You have to Run this Command
sudo apt-get install libpng-dev
In case you hit an error saying it has been installed before, It means you have installed another build of this package. Hence, you have to reinstall it.
sudo apt-get install --reinstall libpng12-0=1.2.51-0ubuntu3
And then, try running npm install
I hope it works.
I solved similar issue in my localhost environment by moving libraries from devDependencies{} into dependencies{}
Otherwise
You should set global Node environment called NODE_ENV to development
NODE_ENV=development
References
How to set NODE_ENV to production/development in OS X
Environment variables in Node.js. The Right way!
I am trying to build my react-native app but I am getting an error:
What went wrong: A problem occurred configuring project ':react-native-vector-icons'.
Could not resolve all files for configuration ':react-native-vector-icons:classpath'.
Could not find any matches for com.android.tools.build:gradle:2.3.+ as no versions of
com.android.tools.build:gradle are available.
I have tried the following commands:
npm install
npm install npm -g
npm rm --cached
git clean -d -fx
npm cache clean --force
npm update
npm upgrade
npm audit fix
npm install react-native-vector-icons --save
I have tried everything I can find on how to resolve this but I cannot get this error to go away. Does anyone know how to resolve this react-native-vector-icons build fail error?
You have to uninstall the react-native-vector-icons plugin first. Then, reinstall it. Just type:
$ npm uninstall react-native-vector-icons$ npm install --save react-native-vector-icons
I'm getting this error when I run npm run test for a create-react-app application for the sample test provided. I tried looking for the EMFILE error but I'm unable to understand what's going wrong.
Error: Error watching file for changes: EMFILE
at exports._errnoException (util.js:1022:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
I had the same issue and discovered watchman was not installed.
Run brew install watchman.
Issue is happening since watchman is not installed on your system.
On Linux, you need to do following
Install Watchman using following commands
git clone https://github.com/facebook/watchman.git
cd watchman/
git checkout v4.9.0
sudo apt-get install -y autoconf automake build-essential python-dev libssl-dev libtool
./autogen.sh
./configure
make
sudo make install
Execute tests
sudo npm test
I am trying to use the ng-factory generator to scaffold a new project to build an angularjs component. After the project has been created with the yo ng-factory command, I tried to run it using the gulp serve task but found the following error:
c:\projects\bywebclient>gulp serve
[11:20:51] Loading C:\projects\bywebclient\gulp_tasks\browsersync.js
[11:20:52] Loading C:\projects\bywebclient\gulp_tasks\karma.js
[11:20:57] Loading C:\projects\bywebclient\gulp_tasks\misc.js
[11:20:57] Loading C:\projects\bywebclient\gulp_tasks\webpack.js
[11:21:07] Using gulpfile c:\projects\bywebclient\gulpfile.js
C:\Users\ATUL KALE\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129
gulpInst.start.apply(gulpInst, toRun);
^
TypeError: Cannot read property 'apply' of undefined
at C:\Users\ATUL KALE\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:
19
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:577:11)
at run (bootstrap_node.js:352:7)
at startup (bootstrap_node.js:144:9)
at bootstrap_node.js:467:3
Am I missing something? I already tried to run again the npm install
Thanks,
Atul Kale
Try to reinstall gulp-cli :
npm install -g gulp-cli
npm install -g gulp-cli
And important: after running that command, open a new terminal so it'll take effect.
Upgrade to 4.0 like this:
npm install --save-dev github:gulpjs/gulp#4.0
Uninstall the global gulp installation and local gulp-cli installation. While keeping global gulp-cli and local gulp packages.
npm uninstall -g gulp
npm uninstall -g gulp-cli
npm install -g gulp-cli
npm install --save-dev github:gulpjs/gulp#4.0
I get below error everytime i run
npm install gulp -g --save
TypeError: Cannot read property 'apply' of undefined
at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickDomainCallback (internal/process/next_tick.js:219:9)
I tried:
npm i -g gulp-cli
and it works for me.
If again i run
npm install gulp -g --save
the above error returns. I noted when i first installed Gulp it was saved in my package.json but now it's absent.
I tried uninstalling both gulp and gulp-cli from my machine (locally and globally), but after uninstall gulp -v, it still showed Gulp CLI 3.9.1, even in new terminal window.
In the end, these are the steps that finally worked for me (seems like CLI simply got cached hard):
Navigate to your project and delete node_modules folder.
Run following:
npm uninstall gulp --global
npm uninstall gulp-cli --global
apt-get remove npm
apt-get remove nodejs
apt-get install nodejs
apt-get install npm
npm install --global gulp-cli
Navigate to your project and run:
npm install
Close current terminal, open new one and check for success:
gulp -v
Should say CLI version 2.1.0 (as of time of writing).
Now you can run your gulp tasks without that error :)
In my case, I had an automated script which was doing npm install gulp (...) and until v3.9x it was fine.
After some time, that naive install would pick v4.0.0, which breaks my CI.
Changing the script to do npm install gulp#3.9.1 reverted things back to normal.
Reinstall gulp and gulp-cli, to install the last version.
npm uninstall -g gulp
npm uninstall -g gulp-cli
npm install -g gulp-cli
npm install -g gulp
And then, close the terminal and open new.
*This command no longer works: npm install --save-dev github:gulpjs/gulp#4.0
I'm new in the Angular development, so I found this template and I would like to use it. So I'm doing this:
sudo apt-get install -y nodejs
sudo apt-get install -y npm
sudo npm install -g bower
sudo npm install -g grunt-cli
Clone the repository of the project:
git clone https://github.com/start-angular/sb-admin-angular.git
cd sb-admin-agular
npm install bower
But when I try to execute the command npm start, it gives me the follow error:
vagrant#TheMachine:~/sb-admin-angular$ npm start
> sb-admin#0.0.0 start /home/vagrant/sb-admin-angular
> grunt serve
/usr/bin/env: node: No such file or directory
npm ERR! weird error 127
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! not ok code 0
vagrant#TheMachine:~/sb-admin-angular$
Any idea how to solve that ? Or what is causing it ?
You might be missing some dependencies. Looks like you only installed bower. Try installing all dependencies using
npm install
Re-follow the installation instructions on the Github page from 5-7:
npm install - bower install is ran from the postinstall
npm start - a shortcut for grunt serve
npm run dist - a shortcut for grunt serve:dist to minify the files for deployment
Some installation routines requires to find the binary "node".
But on Debian based systems the binary is named "nodejs".
To get around this problem I created a syslink.
But be aware that this may introduce other problems later.