如何在本地Web服务器上安装和部署nodejs站点?

时间:2015-05-24 14:29:38

标签: node.js

title - 在本地安装和运行nodejs站点

有人请帮我解决如何安装和构建这个网站并在我的电脑上本地运行它。我已经下载并解压缩了它。

https://github.com/vaalentin/2015

已安装的节点js。 1.“npm install”它不顺利 怎么办???

F:\2015-master\2015-master>npm install
npm WARN package.json 2015@ No description
npm WARN package.json 2015@ No repository field.
npm WARN package.json 2015@ No license field.
npm WARN prefer global npm@2.10.1 should be installed with -g
npm WARN unmet dependency F:\2015-master\2015-master\node_modules\gulp-jsh
de_modules\jshint requires lodash@'3.6.x' but will load
npm WARN unmet dependency F:\2015-master\2015-master\node_modules\gulp-jsh
de_modules\lodash,
npm WARN unmet dependency which is version 3.9.1
npm WARN unmet dependency F:\2015-master\2015-master\node_modules\gulp-jsh
de_modules\rcloader requires lodash@'~2.4.1' but will load
npm WARN unmet dependency F:\2015-master\2015-master\node_modules\gulp-jsh
de_modules\lodash,
npm WARN unmet dependency which is version 3.9.1
npm WARN unmet dependency F:\2015-master\2015-master\node_modules\watchify
modules\browserify\node_modules\browser-pack\node_modules\through2 require
able-stream@'~1.0.17' but will load
npm WARN unmet dependency F:\2015-master\2015-master\node_modules\watchify
modules\browserify\node_modules\readable-stream,
npm WARN unmet dependency which is version 1.1.13

在此之后我在nodejs命令提示符下输入了npm install -g。发生以下错误......

F:\2015-master\2015-master>npm install -g
npm ERR! addLocal Could not install F:\2015-master\2015-master
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "E:\\Program Files\\nodejs\\\\node.exe" "E:\\Program Files\\
\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1

npm ERR! No version provided in package.json
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     F:\2015-master\2015-master\npm-debug.log

F:\2015-master\2015-master>

请帮我解决这个问题。 @slebetman @ michael-blankenship

P.S当我尝试使用笔记本电脑时,我完成了npm安装步骤。 在下一步中,我输入了gulp build。

然后HTML成功,脚本2D成功,脚本3D成功,......

之后停止了什么都没发生。

1 个答案:

答案 0 :(得分:0)

好的,我正在尝试自己安装并记录过程。我有一个N:驱动器映射到我的Node.js文件夹区域,因此Microsoft Windows上的路径不是那么深。

n:
cd \
git clone https://github.com/vaalentin/2015.git 2015-master

响应:

Cloning into '2015-master'...
remote: Counting objects: 807, done.
remote: Total 807 (delta 0), reused 0 (delta 0), pack-reused 807
Receiving objects: 100% (807/807), 74.64 MiB | 1.68 MiB/s, done.
Resolving deltas: 100% (334/334), done.
Checking connectivity... done.
Checking out files: 100% (248/248), done.

下一步:

cd 2015-master
npm install

响应:

npm WARN package.json 2015@ No description
npm WARN package.json 2015@ No repository field.
npm WARN optional dep failed, continuing fsevents@0.3.6
npm ERR! EEXIST, open 'C:\Users\Me\AppData\Roaming\npm-cache\85fb810a-adable-stream-1-0-33-package-tgz.lock'
File exists: C:\Users\Me\AppData\Roaming\npm-cache\85fb810a-adable-stream-1-0-33-package-tgz.lock
Move it away, and try again.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd N:\2015-master
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! path C:\Users\Me\AppData\Roaming\npm-cache\85fb810a-adable-stream-1-0-33-package-tgz.lock
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! not ok code 0

您可以安全地忽略第一个错误,因为它们警告不在package.json文件中的字段。下一个错误表明我的本地节点安装中存在锁定文件。

c:
cd \users\me\appdata\roaming\npm-cache
dir *.lock /s

响应:

Volume in drive C is Windows
Volume Serial Number is E0A6-BC0C
File Not Found

在npm安装步骤中存在npm锁定错误,这是由2015程序的package.json文件中的文件依赖项集合引起的。

n:
cd \2015-master
npm install

响应:

npm WARN package.json 2015@ No description
npm WARN package.json 2015@ No repository field.
gulp-util@3.0.4 node_modules\gulp-util
├── array-differ@1.0.0
├── array-uniq@1.0.2
├── object-assign@2.0.0
├── lodash._reevaluate@3.0.0
├── beeper@1.0.0
├── lodash._reescape@3.0.0
├── lodash._reinterpolate@3.0.0
├── replace-ext@0.0.1
├── minimist@1.1.1
├── vinyl@0.4.6 (clone-stats@0.0.1, clone@0.2.0)
├── lodash.template@3.6.1 (lodash._basecopy@3.0.1, lodash.escape@3.0.0, lodash.restparam@3.6.1, lodash.templatesettings@3.1.0, lodash._basetostring@3.0.0, lodash._isiterateecall@3.0.8, lodash._basevalues@3.0.0, lodash.keys@3.1.0)
├── chalk@1.0.0 (ansi-styles@2.0.1, escape-string-regexp@1.0.3, supports-color@1.3.1, strip-ansi@2.0.1, has-ansi@1.0.3)
├── through2@0.6.5 (xtend@4.0.0, readable-stream@1.0.33)
├── multipipe@0.1.2 (duplexer2@0.0.2)
└── dateformat@1.0.11 (get-stdin@4.0.1, meow@3.1.0)

看起来现在可能只是第二次运行npm install而感到高兴。鉴于此项目中缺少有用的README.md文件,我对如何使用它感到茫然。忽略你得到的错误,在项目目录中再做一次“npm install”。