Where has JSBin been installed? - node.js

I wanted to follow this page to run JSBin locally.
I just installed xcode 8.2 in my mac. Now, npm -v returns 3.10.9; node -v returns v7.2.1. npm install returns
/Users/softtimur/Startup/WebProjects/jsbin$ npm install
> jsbin#3.40.2 postinstall /Users/softtimur/Startup/WebProjects/jsbin
> grunt build && npm run selenium:install
Running "concat:dist" (concat) task
File "public/js/prod/jsbin-3.40.2.js" created.
Running "concat:runner" (concat) task
File "public/js/prod/runner-3.40.2.js" created.
Running "uglify:dist" (uglify) task
File "public/js/prod/jsbin-3.40.2.min.js" created.
Running "uglify:runner" (uglify) task
File "public/js/prod/runner-3.40.2.min.js" created.
Running "uglify:embed" (uglify) task
File "public/js/embed.min.js" created.
Running "uglify:addons" (uglify) task
File "public/js/prod/addon-tern-3.40.2.min.js" created.
Done, without errors.
> jsbin#3.40.2 selenium:install /Users/softtimur/Startup/WebProjects/jsbin
> selenium-standalone install
----------
selenium-standalone installation starting
----------
---
selenium install:
from: https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
to: /Users/softtimur/Startup/WebProjects/jsbin/node_modules/selenium-standalone/.selenium/selenium-server/2.53.1-server.jar
---
chrome install:
from: https://chromedriver.storage.googleapis.com/2.25/chromedriver_mac64.zip
to: /Users/softtimur/Startup/WebProjects/jsbin/node_modules/selenium-standalone/.selenium/chromedriver/2.25-x64-chromedriver
---
firefox install:
from: https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-macos.tar.gz
to: /Users/softtimur/Startup/WebProjects/jsbin/node_modules/selenium-standalone/.selenium/geckodriver/0.11.1-x64-geckodriver
---
File from https://chromedriver.storage.googleapis.com/2.25/chromedriver_mac64.zip has already been downloaded
---
File from https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar has already been downloaded
---
File from https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-macos.tar.gz has already been downloaded
-----
selenium-standalone installation finished
-----
> jsbin#3.40.2 prepublish /Users/softtimur/Startup/WebProjects/jsbin
> npm run snyk-protect
> jsbin#3.40.2 snyk-protect /Users/softtimur/Startup/WebProjects/jsbin
> snyk protect
Successfully applied Snyk patches
It seems that jsbin has been installed, however, I could not find it under /usr/local/lib/node_modules/npm/node_modules/.
Does anyone know where it is?
Edit 1: npm start returns:
/Users/softtimur/Startup/WebProjects/jsbin$ npm start
> jsbin#3.40.2 start /Users/softtimur/Startup/WebProjects/jsbin
> (sleep 2 && open http://localhost:3000) & ./bin/jsbin
Config from /Users/softtimur/Startup/WebProjects/jsbin/lib/config.local.json
module.js:472
throw err;
^
Error: Cannot find module '/Users/softtimur/Startup/WebProjects/jsbin/node_modules/sqlite3/lib/binding/node-v51-darwin-x64/node_sqlite3.node'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/softtimur/Startup/WebProjects/jsbin/node_modules/sqlite3/lib/sqlite3.js:4:15)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/Cellar/node/7.2.1/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.2.1
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! jsbin#3.40.2 start: `(sleep 2 && open http://localhost:3000) & ./bin/jsbin`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jsbin#3.40.2 start script '(sleep 2 && open http://localhost:3000) & ./bin/jsbin'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the jsbin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! (sleep 2 && open http://localhost:3000) & ./bin/jsbin
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs jsbin
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls jsbin
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/softtimur/Startup/WebProjects/jsbin/npm-debug.log
Additionally, I think .bin/jsbin it runs is what has been inside the git folder; it was not built by my npm install.

I could not find it under /usr/local/lib/node_modules/npm/node_modules/
That is to be expected, because you copied the package repo to ~/Startup/WebProjects/jsbin, for use in development, as opposed to using npm install -g jsbin to install it globally, for regular use.
Using npm start from ~/Startup/WebProjects/jsbin, as Benjamin suggests, is the right approach.
npm start does find the jsbin executable, namely in subfolder ./bin (if you look in package.json, key "scripts", you'll see line
"start": "(sleep 2 && open http://localhost:3000) & ./bin/jsbin").
The error message you're getting is actually generated by jsbin itself, indicating a problem with the package's installation.

Related

npm start at reboot doesn't handle destructuring operator (Beaglebone on Debian)

I have a node app that runs nicely from the command line with a npm start command
But when I start it from the crontab #reboot issues the following error:
> pepsr#1.0.104 start /home/debian/Desktop/devel/iot
> node pepsr.js
/home/debian/Desktop/devel/iot/pepsr.js:206
...config
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)
npm ERR! Linux 4.14.108-ti-r113
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v6.17.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! pepsr#1.0.104 start: `node pepsr.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pepsr#1.0.104 start script 'node pepsr.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the pepsr package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node pepsr.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pepsr
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls pepsr
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/debian/Desktop/devel/iot/npm-debug.log
My cron tab is as follows:
#reboot sleep 180 && /home/debian/Desktop/devel/iot/pepsrRestartOnReboot.sh
pepsrRestartOnReboot.sh is as follows:
cd /home/debian/Desktop/devel/iot/
./pepsrStart.sh &
pepsrStart.sh is as follows:
cd /home/debian/Desktop/devel/iot/
nohup ./pepsrRestart.sh >> pepsr.log 2>&1
And pepsrRestart.sh is as follows:
npm start
Two version of node was installed.
What I did:
Uninstalled n:
$ sudo n uninstall
Installed node from the NodeSource:
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -
Actually install node 12 lts:
sudo apt install nodejs
Check that I have what I want:
node -v
v12.22.0

Trying Laravel jetstream but getting an error on "npm run dev"

lam getting the error below while running npm run dev
[webpack-cli] TypeError: this.program.configureOutput is not a function
at new WebpackCLI (/home/vagrant/sites/ecom/node_modules/webpack-cli/lib/webpack-cli.js:19:22)
at runCLI (/home/vagrant/sites/ecom/node_modules/webpack-cli/lib/bootstrap.js:7:21)
at Object. (/home/vagrant/sites/ecom/node_modules/webpack-cli/bin/cli.js:23:5)
at Module._compile (node:internal/modules/cjs/loader:1092:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:996:19)
at require (node:internal/modules/cjs/helpers:92:18)
at runCli (/home/vagrant/sites/ecom/node_modules/webpack/bin/webpack.js:54:2)
npm ERR! code 2
npm ERR! path /home/vagrant/sites/ecom
npm ERR! command failed
npm ERR! command sh -c mix
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2021-03-19T11_14_07_947Z-debug.log
npm ERR! code 2
npm ERR! path /home/vagrant/sites/ecom
npm ERR! command failed
npm ERR! command sh -c npm run development
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2021-03-19T11_14_07_974Z-debug.log
First, try to update your node.js file and then run "npm run dev" and if you again faced the same problem follow the following steps:
Step1: composer update
Step2: rm -rf node_modules
Step3: npm cache clear --force
Step4: npm install
Step5: npm outdated
In this step, it will update your laravel-mix version, it is in the package.json.
Step6: npm install
Step7: npm run dev
After all these steps, everything is good.
I hope it solve your problem.
I came across this problem when trying to build and run webpack (and webpack-cli locally), after check out from Github (not at all related to Laravel).
I found that I forgot to run yarn install for webpack-cli which lead to the issue that an existing version of commander#6 was used, but webpack-cli requires commander#7.
npm list commander should tell you that the webpack-cli dependency is unsatisfied. yarn install should fix it.

Can't install 'node-sass' on Ubuntu 20

I use webpack 4, sass, pug and bemto. Module on windows worked normal, but on Ubuntu:
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! node-sass#4.14.1 postinstall: `node scripts/build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the node-sass#4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I tried enter command:
sudo npm install -g --unsafe-perm node-sass
>
(node:8310) [DEP0139] DeprecationWarning: Calling process.umask() with no arguments is prone to race conditions and is a potential security vulnerability.
(Use `node --trace-deprecation ...` to show where the warning was created)
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
/usr/local/bin/node-sass -> /usr/local/lib/node_modules/node-sass/bin/node-sass
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2725/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> node-sass#4.14.1 install /usr/local/lib/node_modules/node-sass
> node scripts/install.js
Cached binary found at /root/.npm/node-sass/4.14.1/linux-x64-83_binding.node
> node-sass#4.14.1 postinstall /usr/local/lib/node_modules/node-sass
> node scripts/build.js
Binary found at /usr/local/lib/node_modules/node-sass/vendor/linux-x64-83/binding.node
Testing binary
/snap/node/2725/bin/node: symbol lookup error: /usr/local/lib/node_modules/node-sass/vendor/linux-x64-83/binding.node: undefined symbol: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeEPKNS_9CFunctionE
npm WARN You are using a pre-release version of node and things may not work as expected
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! node-sass#4.14.1 postinstall: `node scripts/build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the node-sass#4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
UPD:
I tried:
npm uninstall node-sass
After:
npm install node-sass
Did not help.
I tried:
npm install node-gyp global, save, savedev
ERROR in ./src/sсss/critical.scss (./node_modules/css-loader??ref--5-1!./node_modules/sass-loader/lib/loader.js??ref--5-2!./src/sсss/critical.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Cannot find module 'node-sass'
Require stack:
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/sass-loader/lib/loader.js
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/loader-runner/lib/loadLoader.js
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/loader-runner/lib/LoaderRunner.js
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/webpack/lib/NormalModule.js
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/webpack/lib/NormalModuleFactory.js
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/webpack/lib/Compiler.js
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/webpack/lib/webpack.js
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/webpack-dev-server/bin/webpack-dev-server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1020:15)
at Function.Module._load (internal/modules/cjs/loader.js:890:27)
at Module.require (internal/modules/cjs/loader.js:1080:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/gorevanova/Documents/WebStorm/webpack-static/node_modules/sass-loader/lib/loader.js:3:14)
at Module._compile (internal/modules/cjs/loader.js:1176:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
at Module.load (internal/modules/cjs/loader.js:1040:32)
at Function.Module._load (internal/modules/cjs/loader.js:929:14)
at Module.require (internal/modules/cjs/loader.js:1080:19)
at require (internal/modules/cjs/helpers.js:72:18)
at loadLoader (/home/gorevanova/Documents/WebStorm/webpack-static/node_modules/loader-runner/lib/loadLoader.js:18:17)
at iteratePitchingLoaders (/home/gorevanova/Documents/WebStorm/webpack-static/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
at iteratePitchingLoaders (/home/gorevanova/Documents/WebStorm/webpack-static/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
at /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/loader-runner/lib/LoaderRunner.js:176:18
at loadLoader (/home/gorevanova/Documents/WebStorm/webpack-static/node_modules/loader-runner/lib/loadLoader.js:47:3)
But problem don't leave me.
Run this commands:
rm -rf ./node_modules ./package-lock.json, then
npm cache verify.
PS: I recommend to install nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
Also I don’t know if you already have it, but make sure to also have build-essential install
$ sudo apt update && apt install build-essential
It is a set of c++ compilers and Bunch of useful 💩
something else that I have seen is the lack of python 2.x.x
$ sudo apt install python
Try this, it worked for me
npm i --unsafe-perm node-sass
Please check your node version before install it, node-sass has striction about node versions, shown as below:
refer to https://github.com/sass/node-sass
Cached binary found at /root/.npm/node-sass/4.14.1/linux-x64-83_binding.node
Binary found at /usr/local/lib/node_modules/node-sass/vendor/linux-x64-83/binding.node
Testing binary
I would say the issue could be the fact it's using a cached version from before you upgraded to Ubuntu 20, in which case, removing the cached binary would resolve this.
https://docs.npmjs.com/cli-commands/cache.html
This is just my assumption, what have you tried so far to resolve this issue?

Deploying a meteor 1.2 app to Ubuntu 16.04

I have an app that is still at meteor 1.2 that I used to deploy to ubuntu 14.04 servers happily with mup. However, I have now moved the host server along to 16.04 and mup (as well as mupc) have stopped working.
The last time I deployed one of these apps I followed the procedure below and it worked fine.
apt install nodejs nodejs-legacy
install nvm
nvm install v0.10.40
Bundle the app on my dev box, and unpack it on the host
cd /app/programs/server
npm install
and I get
> fibers#1.0.5 install /opt/sapwfdashboard/programs/server/node_modules/fibers
> node ./build.js
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
internal/child_process.js:298
throw errnoException(err, 'spawn');
^
Error: spawn EACCES
at exports._errnoException (util.js:870:11)
at ChildProcess.spawn (internal/child_process.js:298:11)
at Object.exports.spawn (child_process.js:362:9)
at build (/opt/sapwfdashboard/programs/server/node_modules/fibers/build.js:55:5)
at Object.<anonymous> (/opt/sapwfdashboard/programs/server/node_modules/fibers/build.js:47:3)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
npm ERR! fibers#1.0.5 install: `node ./build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fibers#1.0.5 install script.
npm ERR! This is most likely a problem with the fibers package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls fibers
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.4.0-109-generic
npm ERR! command "/root/.nvm/v0.10.40/bin/node" "/root/.nvm/v0.10.40/bin/npm" "install"
npm ERR! cwd /opt/sapwfdashboard/programs/server
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
I'm stuck. Any idea how to get around this. I am going to have to upgrade this app as the initial deployments are just impossible now.
The best way I've found to deploy this is to use mupc to set up the instances, and then use the manual deployment process from there onwards.
I'm still to work out what the differences are.

Node package installation failing because Node's looking in my root directory for dependacies

While using npm to install packages I've recently had an issue where errors pop up that Node can't find modules/scripts. For some reason it's looking in my C:/ directory, and not C:/my-project/node_modules. This library in particular has been troublesome, but I have seen this happen before too.
I'm running Win7 x32 with v0.10.35 of Node.
This is an example of what I see when I try to install node-sass:
C:\node\test>npm install node-sass
> node-sass#2.0.0-beta install C:\node\test\node_modules\node-sass
> node scripts/install.js
module.js:340
throw err;
^
Error: Cannot find module 'C:\scripts\install.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:929:3
npm ERR! node-sass#2.0.0-beta install: `node scripts/install.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the node-sass#2.0.0-beta install script.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-sass"
npm ERR! cwd C:\node\test
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
A coworker sent me his install.js file, and I placed it in my root just to see what happens. Unfortunately the installation still fails once npm tries to install modules that the root module requires.
I ran into a similar problem while trying to install node-sass onto my Windows system. I reported this as a node-sass issue (see Windows 8.1 Pro 64-bit: gulp-sass install failing due to node-sass#2.1.1 install script failure).
I added some additional logging to my local install of node to see what is actually going on and discovered the following:
nodejs\node_modules\npm\lib\utils\spawn.js is used to start scripts\install.js
By adding some additional logging, I discovered that spawn.js is using the following command line to start install.js: C:\WINDOWS\system32\cmd.exe /c node scripts/install.js
In a separate command prompt window, I changed to my c:\test directory and I ran C:\WINDOWS\system32\cmd.exe /c node to see which directory node is using.
At the node > prompt, I ran process.cwd(). This displayed: c:\\ and not c:\\test
When I saw c:\\ above, I remembered that I added an Autorun setting to HKEY_CURRENT_USER\Software\Microsoft\Command Processor in my Windows registry to automatically run a start up script every time cmd.exe is started. And when I looked at my start up script, I noticed that the last command in that script is: cd c:\. This causes every instance of cmd.exe to use c:\ as its starting directory.
After removing cd c:\ from my start up script, npm install node-sass ran correctly.
I hope this is helpful to others who have run into the issue described in the question above.
I wonder if your 'prefix' configuration variable is set. You can find out by running
> npm c get prefix
It should be set to something reasonable for global packages; if it is set to "C:\" then that may be causing your problem.
You can find out where npm is looking for configuration by running
> npm c get globalconfig
> npm c get localconfig
And you can list all the configuration variables
> npm c ls -l

Resources