我想跟随this page在本地运行JSBin。
我刚在我的mac中安装了xcode 8.2
。现在,npm -v
返回3.10.9
; node -v
返回v7.2.1
。 npm install
返回
/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
似乎已安装了jsbin
,但是,我无法在/usr/local/lib/node_modules/npm/node_modules/
下找到它。
有谁知道它在哪里?
编辑1: npm start
返回:
/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
此外,我认为它运行的.bin/jsbin
是git文件夹中的内容;它不是由npm install
构建的。
答案 0 :(得分:0)
我在/ usr / local / lib / node_modules / npm / node_modules /
下找不到它
这是预料之中的,因为您将软件包repo复制到~/Startup/WebProjects/jsbin
,以便在开发中使用,而不是使用npm install -g jsbin
来全局安装 ,用于常规使用。
正如本杰明所说,使用npm start
中的~/Startup/WebProjects/jsbin
是正确的做法。
npm start
找到jsbin
可执行文件,即子文件夹 ./bin
(如果您查看package.json
,键"scripts"
,你会看到行
"start": "(sleep 2 && open http://localhost:3000) & ./bin/jsbin"
)。
您获得的错误消息实际上是由jsbin
本身生成的,表明软件包的安装存在问题。