ict.ken.be

 

Posts in Category: Nodejs

npm WARN optional SKIPPING OPTIONAL DEPENDENCY 

Categories: Nodejs

Depending on the operating system you are using, you might get warnings like these:

  • npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\fsevents)

Warnings for sure are useful during development, but they just overload build servers with noise that should only be there when requested.

You could use npm install --loglevel=error to prevent the warnings to show up in your build logs.

In case you have hard time finding an issue, you could go with npm install --loglevel=silly

(loglevels: silent, error, warn, info, verbose, silly - see also https://docs.npmjs.com/misc/config)

npx react-native start gives invalid regular expression 

Categories: Nodejs Reactjs

Most likely your 'node_modules\metro-config\src\defaults\blacklist.js' has an invalid regular expression.

You can correct it with the expression below

var sharedBlacklist = [
  /node_modules[\/\\]react[\/\\]dist[\/\\].*/,
  /website\/node_modules\/.*/,
  /heapCapture\/bundle\.js/,
  /.*\/__tests__\/.*/
];

However, it's more likely that you just downloaded an older react-native example and are trying to run this with a different version than intended.

You could ensure that you install all the package.json dependencies fixed to the version the example was build with.

Or you could upgrade all packages to their latest version and fix any issues that might come from that.

At least with the second option you are ready to go with all the latest tools.

Upgrading Nodejs package.json dependencies 

Categories: Javascript Nodejs

Doing a minor update

  • npm update

Doing a major update

Ensure you have the 'check updates' module installed, which will give you the ncu command.

npm install -g npm-check-updates
  • npm outdated
  • ncu -u
  • npm update
  • npm install

If you keep getting: NCU Real Time Weather is Running......

You installed the module called ncu and will need to uninstall this one first.

npm uninstall ncu -g
npm install -g npm-check-updates -- force

Install global node in different location on windows 

Categories: Nodejs

Change global nodejs location

  • Install into c:\tools\vendor\nodejs
  • Create folder c:\tools\vendor\nodejs\npm-cache
  • Create folder c:\tools\vendor\nodejs\etc
  • Set NODE environment variable as c:\tools\vendor\nodejs
  • Ensure %NODE% environment is added to %PATH%
  • Set NODE_PATH environment variable as c:\tools\vendor\nodejs\node_modules
  • Edit %NODE_PATH%\npm\npmrc with the following content prefix=c:\tools\vendor\nodejs
  • npm config --global set prefix "c:\tools\vendor\nodejs"
  • npm config --global set cache "c:\tools\vendor\nodejs\npm-cache"
  • npm -g install npm@latest
  • install any npm module

npmrc

prefix=c:\tools\vendor\nodejs
cache=c:\tools\vendor\npm-cache
strict-ssl=false
registry=http://registry.npmjs.org/
proxy=http://proxy.myplace.com:3128/
https-proxy=http://proxy.myplace.com:3128/
http-proxy=proxy.myplace.com:3128

nodejs-for-visual-studio 

Categories: Nodejs Visual Studio

Nodejs tools for visual studio

Nodejs interactive window

  • ctrl-K, N
  • .npm -v

Nodejs location in vs 2015

  • Tools > Options > Projects & Solutions > External Web Tools

Nodejs max path issues (solved from v5)

  • npm install npm-windows-upgrade -g && npm-windows-upgrade --npm-path "c:\tools\vendor\nodejs"
  • npm install rimraf -g
  • npm dedupe
  • npm install flatten-packages -g (might give version conflicts)

More

Page 1 of 2 1 2 > >>