NodeJS折腾记--------------------------------------- Mac OSX 1. 删除/usr/local/lib中的所有node和node_modules 2

2015.10.22

开始提出MPEG_DASH  dynamic adaptive streaming over http

DASH——RTMP(flash)——HLS(Apple,用于移动端较多)——HDS(Adobe)——MSS(微软)自适应码率

flv,mp4,3gpp/mp4(dash),mpeg-ts(hls)

 

dash:一个mpd文件和文件片段

开发语言:js

开发工具:Node.js       (tibao 说他们开发H5用的webstorm啊)

参考文档:https://github.com/Dash-Industry-Forum/dash.js

node及npm安装:

http://nodejs.cn/  Windows下载msi文件安装即可

http://nodejs.org/download/ 下载安装文件

在mac上下载pkg文件

node及npm卸载:(mac)

---------------------------------------
Mac OSX

1. 删除/usr/local/lib中的所有node和node_modules
2. 删除/usr/local/lib中的所有node和node_modules的文件夹
3. 如果是从brew安装的, 运行brew uninstall node
4. 检查~/中所有的local, lib或者include文件夹, 删除里面所有node和node_modules
5. 在/usr/local/bin中, 删除所有node的可执行文件
6. 最后运行以下代码:(可能具体安装路径会有区别 ,find ~ -name "node"   可以找到所有

sudo rm /usr/local/bin/npm
sudo rm /usr/local/share/man/man1/node.1
sudo rm /usr/local/lib/dtrace/node.d
sudo rm -rf ~/.npm
sudo rm -rf ~/.node-gyp
sudo rm /opt/local/bin/node
sudo rm /opt/local/include/node
sudo rm -rf /opt/local/lib/node_modules
---------------------------------------
Linux

1. 如果是apt-get安装的, 直接

sudo apt-get remove nodejs

2. 如果不是:

rm -r bin/node bin/node-waf include/node lib/node lib/pkgconfig/nodejs.pc share/man/man1/node.1

(为什么这里一设置代码格式所有内容就消失...)


 

2015.10.23

基于安装node.js的前提,安装Grunt   http://gruntjs.com/plugins

操作步骤:

http://www.cnblogs.com/yexiaochai/p/3603389.html

 

1.      cmd调出Dos命令行

检验node –v

    npm -v

2.      输入:npm install –g grunt –cli

此时会安装grunt,应该会在环境变量中添加全局变量,grunt命令不被识别

将npm安装目录下的node_modules文件夹、grunt、grunt.cmd复制到工作目录

3.      输入:npm install

必须要有package.json和GruntFile.js文件

输入:npm install grunt-contrib-watch

      npm installgrunt-contrib-jshint

      npm installgrunt-contrib-uglify

貌似有网络错误,重新输入命令安装即可

      npm installgrunt-contrib-qunit  (这个要安装比较久)

      npm installgrunt-contrib-concat

      npm installgrunt-contrib-clean

      npm installgrunt-contrib-copy

      npm installgrunt-contrib-cssmin (下载了所有标注星号的)

      npm installgrunt-contrib-connect  安装这个居然出现了不断刷屏的ERROR LOG,后来提示Callback called more than once. 停止刷屏后重新安装即可

-------------------分割线,以上是看dash开源项目,并没有部署成功-----------------------

后来下载了bemTV的hlsp2p开源项目,决定一定要看下,额,又是NodeJS

1.npm install下载错误

2.安装在D盘的nodeJS依赖库,在E盘可以使用吗???????暂时不知道

3. 直接运行npm test,提示gulp不是内部或外部命令,额,好吧,我并没有安装gulp

     npm install -g gulp   全局安装gulp

    在指定项目目录下局部安装gulp, npm install gulp

    然而仍旧提示“gulp不是内部或外部命令”

    命令行输入“npm root -g"   ,输出        C:\Users\dell\AppData\Roaming\npm\node_modules

    已设置用户环境变量中的PATH=C:\Users\dell\AppData\Roaming\npm\node_modules,NODE_PATH=C:\Users\dell\AppData\Roaming\npm\node_modules

    系统环境变量中的Path  =D:\Program Files\nodejs

   为神马???

4.改换mac osx

  需要使用sudo安装命令,否则会提示权限错误

 直接输入npm install会提示出错,error: no member named "Use" in namespace....之类的错误

  需要使用最新的npm版本,安装命令为 sudo npm install npm-check-updates -g

    

-----------------------------problems

1.mac上编译提示缺少underscore模块,但实际上存在啊

Uncaught Error: Cannot find module 'underscore'

  at /Users/youku/bemtv/clappr-p2phls-plugin/2e323baca1b7f5eb112ea5556a2f7db055a7bd34.browserify:1 <- node_modules/browserify/node_modules/browser-pack/_prelude.js:1:0


使用node 4.2.6编译时,出现如下错误:

In file included from ../binding.cpp:1:

../node_modules/nan/nan.h:189:68: error: too many arguments to function call,

      expected at most 2, have 4

    return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv);

           ~~~~~~~~~~~~~~~~~~                                      ^~~~~~~~~~

/Users/youku/.node-gyp/4.2.6/include/node/v8.h:4675:3: note:'New' declared here

  static Local New(

  ^

In file included from ../binding.cpp:1:

../node_modules/nan/nan.h:271:3: error: redefinition of 'NanNew'

  NanNew >(

  ^

../node_modules/nan/nan.h:264:3: note: previous definition is here

  NanNew >(

  ^

../node_modules/nan/nan.h:289:36: error: redefinition of 'NanNew'

  NAN_INLINE v8::Local NanNew(

                                   ^

../node_modules/nan/nan.h:283:36: note: previous definition is here

  NAN_INLINE v8::Local NanNew(

                                   ^

../node_modules/nan/nan.h:301:36: error: redefinition of 'NanNew'

  NAN_INLINE v8::Local NanNew(

                                   ^

../node_modules/nan/nan.h:295:36: note: previous definition is here

  NAN_INLINE v8::Local NanNew(

                                   ^

../node_modules/nan/nan.h:481:19: error: no type named

      'ExternalAsciiStringResource' in 'v8::String'; did you mean

      'ExternalStringResource'?

      v8::String::ExternalAsciiStringResource *resource) {

      ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~

                  ExternalStringResource

/Users/youku/.node-gyp/4.2.6/include/node/v8.h:2210:19: note: 

      'ExternalStringResource' declared here

  class V8_EXPORT ExternalStringResource

                  ^

In file included from ../binding.cpp:1:

../node_modules/nan/nan.h:480:36: error: redefinition of 'NanNew'

  NAN_INLINE v8::Local NanNew(

                                   ^

../node_modules/nan/nan.h:475:36: note: previous definition is here

  NAN_INLINE v8::Local NanNew(

                                   ^

../node_modules/nan/nan.h:495:27: error: redefinition of '_NanEscapeScopeHelper'

  NAN_INLINE v8::Local _NanEscapeScopeHelper(v8::Local val) {

                          ^

../node_modules/nan/nan.h:490:27: note: previous definition is here

  NAN_INLINE v8::Local _NanEscapeScopeHelper(v8::Handle val) {

                          ^

../node_modules/nan/nan.h:511:12: error: no matching function for call to

      '_NanEscapeScopeHelper'

    return NanEscapeScope(NanNew(v8::Undefined(v8::Isolate::GetCurrent())));

           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../node_modules/nan/nan.h:499:43: note: expanded from macro 'NanEscapeScope'

# define NanEscapeScope(val) scope.Escape(_NanEscapeScopeHelper(val))

                                          ^~~~~~~~~~~~~~~~~~~~~

../node_modules/nan/nan.h:495:27: note: candidate template ignored: substitution

      failure [with T = v8::Primitive]

  NAN_INLINE v8::Local _NanEscapeScopeHelper(v8::Local val) {

                          ^

../node_modules/nan/nan.h:516:12: error: no matching function for call to

      '_NanEscapeScopeHelper'

    return NanEscapeScope(NanNew(v8::Null(v8::Isolate::GetCurrent())));

           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../node_modules/nan/nan.h:499:43: note: expanded from macro 'NanEscapeScope'

# define NanEscapeScope(val) scope.Escape(_NanEscapeScopeHelper(val))

                                          ^~~~~~~~~~~~~~~~~~~~~

../node_modules/nan/nan.h:495:27: note: candidate template ignored: substitution

      failure [with T = v8::Primitive]

  NAN_INLINE v8::Local _NanEscapeScopeHelper(v8::Local val) {

                          ^

../node_modules/nan/nan.h:521:12: error: no matching function for call to

      '_NanEscapeScopeHelper'

    return NanEscapeScope(NanNew(v8::True(v8::Isolate::GetCurrent())));

           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../node_modules/nan/nan.h:499:43: note: expanded from macro 'NanEscapeScope'

# define NanEscapeScope(val) scope.Escape(_NanEscapeScopeHelper(val))

                                          ^~~~~~~~~~~~~~~~~~~~~

../node_modules/nan/nan.h:495:27: note: candidate template ignored: substitution

      failure [with T = v8::Boolean]

  NAN_INLINE v8::Local _NanEscapeScopeHelper(v8::Local val) {

                          ^

../node_modules/nan/nan.h:526:12: error: no matching function for call to

      '_NanEscapeScopeHelper'

    return NanEscapeScope(NanNew(v8::False(v8::Isolate::GetCurrent())));

           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../node_modules/nan/nan.h:499:43: note: expanded from macro 'NanEscapeScope'

# define NanEscapeScope(val) scope.Escape(_NanEscapeScopeHelper(val))

                                          ^~~~~~~~~~~~~~~~~~~~~

../node_modules/nan/nan.h:495:27: note: candidate template ignored: substitution

      failure [with T = v8::Boolean]

  NAN_INLINE v8::Local _NanEscapeScopeHelper(v8::Local val) {

                          ^

../node_modules/nan/nan.h:755:13: error: no member named 'smalloc' in namespace

      'node'

    , node::smalloc::FreeCallback callback

      ~~~~~~^

../node_modules/nan/nan.h:766:12: error: no matching function for call to 'New'

    return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);

           ^~~~~~~~~~~~~~~~~

/Users/youku/.node-gyp/4.2.6/include/node/node_buffer.h:31:40: note:candidate

      function not viable: no known conversion from 'uint32_t'

      (aka 'unsigned int') to 'enum encoding' for 3rd argument

NODE_EXTERN v8::MaybeLocal New(v8::Isolate* isolate,

                                       ^

/Users/youku/.node-gyp/4.2.6/include/node/node_buffer.h:43:40: note:candidate

      function not viable: 2nd argument ('const char *') would lose const

      qualifier

NODE_EXTERN v8::MaybeLocal New(v8::Isolate* isolate,

                                       ^

/Users/youku/.node-gyp/4.2.6/include/node/node_buffer.h:28:40: note:candidate

      function not viable: requires 2 arguments, but 3 were provided

NODE_EXTERN v8::MaybeLocal New(v8::Isolate* isolate, size_t length);

                                       ^

/Users/youku/.node-gyp/4.2.6/include/node/node_buffer.h:36:40: note:candidate

      function not viable: requires 5 arguments, but 3 were provided

NODE_EXTERN v8::MaybeLocal New(v8::Isolate* isolate,

                                       ^

In file included from ../binding.cpp:1:

../node_modules/nan/nan.h:770:12: error: no viable conversion from

      'v8::MaybeLocal' to 'v8::Local'

    return node::Buffer::New(v8::Isolate::GetCurrent(), size);

           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/Users/youku/.node-gyp/4.2.6/include/node/v8.h:210:7: note:candidate

      constructor (the implicit copy constructor) not viable: no known

      conversion from 'v8::MaybeLocal' to 'const

      v8::Local &' for 1st argument

class Local {

      ^

/Users/youku/.node-gyp/4.2.6/include/node/v8.h:210:7: note:candidate

      constructor (the implicit move constructor) not viable: no known

      conversion from 'v8::MaybeLocal' to 'v8::Local &&'

      for 1st argument

class Local {

      ^

/Users/youku/.node-gyp/4.2.6/include/node/v8.h:214:13: note:candidate template

      ignored: could not match 'Local' against 'MaybeLocal'

  V8_INLINE Local(Local that)

            ^

/Users/youku/.node-gyp/4.2.6/include/node/v8.h:326:13: note:candidate template

      ignored: could not match 'S *' against 'v8::MaybeLocal'

  V8_INLINE Local(S* that)

            ^

In file included from ../binding.cpp:1:

../node_modules/nan/nan.h:777:26: error: no member named 'Use' in namespace

      'node::Buffer'

    return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);

           ~~~~~~~~~~~~~~^

../node_modules/nan/nan.h:1809:12: error: no matching function for call to

      '_NanEscapeScopeHelper'

    return NanEscapeScope(NanNew(handle)->Get(kCallbackIndex)

           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../node_modules/nan/nan.h:499:43: note: expanded from macro 'NanEscapeScope'

# define NanEscapeScope(val) scope.Escape(_NanEscapeScopeHelper(val))

                                          ^~~~~~~~~~~~~~~~~~~~~

../node_modules/nan/nan.h:495:27: note: candidate template ignored: substitution

      failure [with T = v8::Function]

  NAN_INLINE v8::Local _NanEscapeScopeHelper(v8::Local val) {

                          ^

../node_modules/nan/nan.h:1824:12: error: no matching function for call to

      '_NanEscapeScopeHelper'

    return NanEscapeScope(node::MakeCallback(

           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../node_modules/nan/nan.h:499:43: note: expanded from macro 'NanEscapeScope'

# define NanEscapeScope(val) scope.Escape(_NanEscapeScopeHelper(val))

                                          ^~~~~~~~~~~~~~~~~~~~~

../node_modules/nan/nan.h:495:27: note: candidate template ignored: substitution

      failure [with T = v8::Value]

  NAN_INLINE v8::Local _NanEscapeScopeHelper(v8::Local val) {

                          ^

../node_modules/nan/nan.h:1897:12: error: no matching function for call to

      '_NanEscapeScopeHelper'

    return NanEscapeScope(handle->Get(NanNew(key)).As());

           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../node_modules/nan/nan.h:499:43: note: expanded from macro 'NanEscapeScope'

# define NanEscapeScope(val) scope.Escape(_NanEscapeScopeHelper(val))

                                          ^~~~~~~~~~~~~~~~~~~~~

../node_modules/nan/nan.h:495:27: note: candidate template ignored: substitution

      failure [with T = v8::Object]

  NAN_INLINE v8::Local _NanEscapeScopeHelper(v8::Local val) {

                          ^

../node_modules/nan/nan.h:2103:12: error: no member named 'IsExternalAscii' in

      'v8::String'; did you mean 'IsExternal'?

  if (str->IsExternalAscii()) {

           ^~~~~~~~~~~~~~~

           IsExternal

/Users/youku/.node-gyp/4.2.6/include/node/v8.h:2174:8: note:'IsExternal'

      declared here

  bool IsExternal() const;

       ^

fatal error: too many errors emitted, stopping now [-ferror-limit=]

20 errors generated.

make: *** [Release/obj.target/binding/binding.o] Error 1

gyp ERR!build error 

gyp ERR!stack Error: `make` failed with exit code: 2

gyp ERR!stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)

gyp ERR!stack     at emitTwo (events.js:87:13)

gyp ERR!stack     at ChildProcess.emit (events.js:172:7)

gyp ERR!stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

gyp ERR!System Darwin 14.1.1

gyp ERR!command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

gyp ERR!cwd /Users/youku/bemtv2/clappr-p2phls-plugin/node_modules/gulp-sass/node_modules/node-sass

gyp ERR!node -v v4.2.6

gyp ERR!node-gyp -v v3.0.3

gyp ERR!not ok 

Build failed

npm ERR! Darwin 14.1.1

npm ERR!argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"

npm ERR!node v4.2.6

npm ERR!npm  v2.14.12

npm ERR!code ELIFECYCLE


npm ERR! [email protected] install: `node build.js`


使用node 0.10.34编译时,出现 TypeError Object:keys called on non-object



使用node 0.12.8编译时,修改了package.json中指定的module版本,但出现以下错误提示,安装失败

shasum check failed for /tmp/npm-507-53887596/registry.npmjs.org/ruglify/-/ruglify-1.0.0.tgz

你可能感兴趣的:(NodeJS折腾记--------------------------------------- Mac OSX 1. 删除/usr/local/lib中的所有node和node_modules 2)