npm编译creator引擎源码问题

比如我想要修改engine\extensions\dragonbones其中的一些代码
参考教程http://www.cocos.com/docs/creator/advanced-topics/engine-customization.html

参照教程首先安装了nodejs
来到我的引擎目录
D:\CocosCreator\resources\engine

按照教程中写的以下三步

Install the gulp build tool

npm install-g gulp

Enter the engine path from the command line

npm install
`Bash gulp build ``

第一步

第二步
然后安装?好像哪里不对(下面是log)
D:\CocosCreator\resources\engine>npm install
npm http GET https://registry.npmjs.org/browserify/13.0.0
npm http GET https://registry.npmjs.org/chalk/1.1.0
npm http GET https://registry.npmjs.org/del/1.2.0
npm http GET https://registry.npmjs.org/event-stream/3.3.2
npm http GET https://registry.npmjs.org/fire-fs/0.2.1
npm http GET https://registry.npmjs.org/gulp/3.9.0
npm http GET https://registry.npmjs.org/gulp-cached/1.1.0
npm http GET https://registry.npmjs.org/gulp-concat/2.6.0
npm http GET https://registry.npmjs.org/gulp-fb/0.5.1
npm http GET https://registry.npmjs.org/gulp-header/1.2.2
npm http GET https://registry.npmjs.org/gulp-jshint/1.11.2
npm http GET https://registry.npmjs.org/gulp-mirror/0.4.0
npm http GET https://registry.npmjs.org/gulp-plumber/0.6.6
npm http GET https://registry.npmjs.org/gulp-rename/1.2.2
npm http GET https://registry.npmjs.org/gulp-shell/0.4.1
npm http GET https://registry.npmjs.org/gulp-size/2.1.0
npm http GET https://registry.npmjs.org/gulp-sourcemaps/1.5.2
npm http GET https://registry.npmjs.org/gulp-uglify/1.5.3
npm http GET https://registry.npmjs.org/gulp-util/3.0.6
npm http GET https://registry.npmjs.org/jshint-stylish/2.1.0
npm http GET https://registry.npmjs.org/multipipe/0.3.0
npm http GET https://registry.npmjs.org/require-dir/0.3.0
npm http GET https://registry.npmjs.org/vinyl/1.1.0
npm http GET https://registry.npmjs.org/vinyl-buffer/1.0.0
npm http GET https://registry.npmjs.org/vinyl-source-stream/1.0.0
npm http GET https://registry.npmjs.org/watchify
npm http GET https://registry.npmjs.org/async/1.5.2

npm ERR! Error: SSL Error: CERT_UNTRUSTED
npm ERR! at ClientRequest. (C:\Program Files (x86)\nodejs\node_mo
dules\npm\node_modules\request\main.js:483:26)
npm ERR! at ClientRequest.g (events.js:156:14)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1256:
7)
npm ERR! at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.
js:91:29)
npm ERR! at CleartextStream.socketOnData [as ondata] (http.js:1288:20)
npm ERR! at CleartextStream._push (tls.js:375:27)
npm ERR! at SecurePair.cycle (tls.js:734:20)
npm ERR! at EncryptedStream.write (tls.js:130:13)
npm ERR! at Socket.ondata (stream.js:38:26)
npm ERR! You may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com
npm ERR!
npm ERR! System Windows_NT 6.1.7601
npm ERR! command “C:\Program Files (x86)\nodejs\\node.exe” “C:\Program File
s (x86)\nodejs\node_modules\npm\bin\npm-cli.js” “install”
npm ERR! cwd D:\CocosCreator\resources\engine
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.24
npm ERR! message SSL Error: CERT_UNTRUSTED
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! D:\CocosCreator\resources\engine\npm-debug.log
npm not ok
npm not ok

第三步,最后一个命令
D:\CocosCreator\resources\engine>gulp build
‘gulp’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。

请教一下哪里错了,应该怎么样编译?

是因为node版本问题么?

求助!

我们一般使用的是 v5 或者 v6,你可以用 nvm 升级试试,记得要重新 install modules

然后你遇到的问题是 SSL 的证书未被信任,不确定根本原因是什么,可以升级试试

第一步就错了吧,根本就没有 install-g 这个命令,是 install<空格>-g

升级了nodejs版本又试了一遍

4-1npm install -g gulp

命令成功

4-2接下来 npm install 命令,请求等待了片刻之后报错?

C:\CocosCreator\resources\engine>npm install
npm ERR! Windows_NT 6.1.7601
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js” “install”
npm ERR! node v6.11.0
npm ERR! npm v3.10.10

npm ERR! Cannot convert undefined or null to object
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! C:\CocosCreator\resources\engine\npm-debug.log

4-3然后提示我gulp没有安装,按提示安装

C:\CocosCreator\resources\engine>gulp build
[10:43:29] Local gulp not found in C:\CocosCreator\resources\engine
[10:43:29] Try running: npm install gulp

C:\CocosCreator\resources\engine>npm install gulp
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher
to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher
to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail o
n node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible
. Use ‘npm ls graceful-fs’ to find it in the tree.
cocos-creator-js@1.4.1 C:\CocosCreator\resources\engine
-- gulp@3.9.0 +-- archy@1.0.0 +-- chalk@1.1.3 | +-- ansi-styles@2.2.1 | +-- escape-string-regexp@1.0.5 | +-- has-ansi@2.0.0 | | – ansi-regex@2.1.1
| ±- strip-ansi@3.0.1
| -- supports-color@2.0.0 +-- deprecated@0.0.1 +-- gulp-util@3.0.8 | +-- array-differ@1.0.0 | +-- array-uniq@1.0.3 | +-- beeper@1.1.1 | +-- dateformat@2.0.0 | +-- fancy-log@1.3.0 | | – time-stamp@1.1.0
| ±- gulplog@1.0.0
| | -- glogg@1.0.0 | +-- has-gulplog@0.1.0 | | – sparkles@1.0.0
| ±- lodash._reescape@3.0.0
| ±- lodash._reevaluate@3.0.0
| ±- lodash._reinterpolate@3.0.0
| ±- lodash.template@3.6.2
| | ±- lodash._basecopy@3.0.1
| | ±- lodash._basetostring@3.0.1
| | ±- lodash._basevalues@3.0.0
| | ±- lodash._isiterateecall@3.0.9
| | ±- lodash.escape@3.2.0
| | | -- lodash._root@3.0.1 | | +-- lodash.keys@3.1.2 | | | +-- lodash._getnative@3.9.1 | | | +-- lodash.isarguments@3.1.0 | | | – lodash.isarray@3.0.4
| | ±- lodash.restparam@3.6.1
| | -- lodash.templatesettings@3.1.1 | +-- multipipe@0.1.2 | | – duplexer2@0.0.2
| | -- readable-stream@1.1.14 | +-- object-assign@3.0.0 | +-- replace-ext@0.0.1 | +-- through2@2.0.3 | | +-- readable-stream@2.2.11 | | | +-- core-util-is@1.0.2 | | | +-- inherits@2.0.3 | | | +-- isarray@1.0.0 | | | +-- process-nextick-args@1.0.7 | | | +-- safe-buffer@5.0.1 | | | +-- string_decoder@1.0.2 | | | – util-deprecate@1.0.2
| | -- xtend@4.0.1 | – vinyl@0.5.3
| ±- clone@1.0.2
| -- clone-stats@0.0.1 +-- interpret@0.6.6 +-- liftoff@2.3.0 | +-- extend@3.0.1 | +-- findup-sync@0.4.3 | | +-- detect-file@0.1.0 | | | – fs-exists-sync@0.1.0
| | ±- is-glob@2.0.1
| | | -- is-extglob@1.0.0 | | +-- micromatch@2.3.11 | | | +-- arr-diff@2.0.0 | | | | – arr-flatten@1.0.3
| | | ±- array-unique@0.2.1
| | | ±- braces@1.8.5
| | | | ±- expand-range@1.8.2
| | | | | -- fill-range@2.2.3 | | | | | +-- is-number@2.1.0 | | | | | +-- isobject@2.1.0 | | | | | | – isarray@1.0.0
| | | | | ±- randomatic@1.1.7
| | | | | | ±- is-number@3.0.0
| | | | | | | -- kind-of@3.2.2 | | | | | | – kind-of@4.0.0
| | | | | -- repeat-string@1.6.1 | | | | +-- preserve@0.2.0 | | | | – repeat-element@1.1.2
| | | ±- expand-brackets@0.1.5
| | | | -- is-posix-bracket@0.1.1 | | | +-- extglob@0.3.2 | | | +-- filename-regex@2.0.1 | | | +-- kind-of@3.2.2 | | | | – is-buffer@1.1.5
| | | ±- normalize-path@2.1.1
| | | | -- remove-trailing-separator@1.0.2 | | | +-- object.omit@2.0.1 | | | | +-- for-own@0.1.5 | | | | | – for-in@1.0.2
| | | | -- is-extendable@0.1.1 | | | +-- parse-glob@3.0.4 | | | | +-- glob-base@0.3.0 | | | | | – glob-parent@2.0.0
| | | | -- is-dotfile@1.0.3 | | | – regex-cache@0.4.3
| | | ±- is-equal-shallow@0.1.3
| | | -- is-primitive@2.0.0 | | – resolve-dir@0.1.1
| | -- global-modules@0.2.3 | | +-- global-prefix@0.1.5 | | | +-- homedir-polyfill@1.0.1 | | | | – parse-passwd@1.0.0
| | | ±- ini@1.3.4
| | | -- which@1.2.14 | | | – isexe@2.0.0
| | -- is-windows@0.2.0 | +-- fined@1.0.2 | | +-- expand-tilde@1.2.2 | | +-- lodash.assignwith@4.2.0 | | +-- lodash.isempty@4.4.0 | | +-- lodash.pick@4.4.0 | | – parse-filepath@1.0.1
| | ±- is-absolute@0.2.6
| | | -- is-relative@0.2.1 | | | – is-unc-path@0.1.2
| | | -- unc-path-regex@0.1.2 | | +-- map-cache@0.2.2 | | – path-root@0.1.1
| | -- path-root-regex@0.1.2 | +-- flagged-respawn@0.3.2 | +-- lodash.isplainobject@4.0.6 | +-- lodash.isstring@4.0.1 | +-- lodash.mapvalues@4.6.0 | +-- rechoir@0.6.2 | – resolve@1.3.3
| -- path-parse@1.0.5 +-- minimist@1.2.0 +-- orchestrator@0.3.8 | +-- end-of-stream@0.1.5 | | – once@1.3.3
| | -- wrappy@1.0.2 | +-- sequencify@0.0.7 | – stream-consume@0.1.0
±- pretty-hrtime@1.0.3
±- semver@4.3.6
±- tildify@1.2.0
| -- os-homedir@1.0.2 +-- v8flags@2.1.1 | – user-home@1.1.1
-- vinyl-fs@0.3.14 +-- defaults@1.0.3 +-- glob-stream@3.1.18 | +-- glob@4.5.3 | | – inflight@1.0.6
| ±- glob2base@0.0.12
| | -- find-index@0.1.1 | +-- minimatch@2.0.10 | | – brace-expansion@1.1.7
| | ±- balanced-match@0.4.2
| | -- concat-map@0.0.1 | +-- ordered-read-streams@0.1.0 | +-- through2@0.6.5 | | – readable-stream@1.0.34
| -- unique-stream@1.0.0 +-- glob-watcher@0.0.6 | – gaze@0.5.2
| -- globule@0.1.0 | +-- glob@3.1.21 | | +-- graceful-fs@1.2.3 | | – inherits@1.0.2
| ±- lodash@1.0.2
| -- minimatch@0.2.14 | +-- lru-cache@2.7.3 | – sigmund@1.0.1
±- graceful-fs@3.0.11
| -- natives@1.1.0 +-- mkdirp@0.5.1 | – minimist@0.0.8
±- strip-bom@1.0.0
| ±- first-chunk-stream@1.0.0
| -- is-utf8@0.2.1 +-- through2@0.6.5 | – readable-stream@1.0.34
| ±- isarray@0.0.1
| -- string_decoder@0.10.31 – vinyl@0.4.6
`-- clone@0.2.0

npm WARN cocos-creator-js@1.4.1 No repository field.

4-4最后build报错

C:\CocosCreator\resources\engine>gulp build
[10:44:46] Warning: gulp version mismatch:
[10:44:46] Global gulp is 3.9.1
[10:44:46] Local gulp is 3.9.0
module.js:471
throw err;
^

Error: Cannot find module ‘del’
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (C:\CocosCreator\resources\engine\gulpfile.js:30:13)
at Module._compile (module.js:570:32)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)

这次用的最新的nodejs
是第二步install的问题么?求助

我还以为是用build目录下的工程文件编译出来的,昨天编译出来的.a文件和自带的文件大小差的有点大,具体能不能用还没有试

我也是遇到这个问题 后来 npm install del 解决了这个 但是后面还有一系列这个问题。。。。最后还是没法解决

npm install 都没成功,后面肯定就都跪了