为什么我的淘宝cnpm安装装好了还是查不出版本号

是时候放弃用 cnpm 命令了 - CNode技术社区
这家伙很懒,什么个性签名都没有留下。
在我们中国,要下载 npm 包非常慢,如果使用 cnpm 下载包就非常快了,感觉很爽,但是 cnpm 也有几个大问题:
<pm 的仓库只是 npm 仓库的一个拷贝,它不承担 publish 工作,所以你
2.不仅是 publish 会执行失败,其它的需要注册用户(npm adduser)、或者都无法用 cnpm
3.有很多 npm 包都集成了 npm install,比如
的所有 generators ,在最后基本都会调用 npm install,( 可以看其 )这种情况下使用 cnpm 完全无效,必须中断操作,然后自己手动运行 cnpm install,或者在运行 yo [generator] 时就指定 --skip-install,这体验就很不爽了
4.还有一种情况是,很多和 npm API 相关的 package,都会读取 ~/.npmrc 中的 registry,或者使用默认的 registry —— [][npm-registry],去查询 npm package 相关的信息,比如下面这些:
: 查询某个 package 的最新版本号
: 查询某个 package name 是否被注册了
: 查找某个模块所依赖的其它所有模块
如果你用的任何一个包或其所依赖的包中用了这些 package,那么在这些包请求网络时也得慢死了!
怎么解决上面的问题呢?
可以来使用我写的
模块,它封装了 npm 和 cnpm 在里面,根据你使用的命令自动切换 npm 或者 cnpm。
更多详情可以去 ,也欢迎诸位!
我有一个建议,就是把包名取短一点。snpm 之类的。
这个倒不是很必要,因为你安装 smart-npm 后,它会取代你系统的 npm 的,使用的时候并不需要使用 smart-npm 命令,直接用 npm 就行,这就是为什么我叫它 smart-npm。
真的用上cnpm的用户不会只用cnpm的国内镜像功能,都会在内部搭上一个企业私有npm
自豪地采用
这我到是没用过,研究下,谢谢了
我们中国还是有很多个人用户用 npm 或者 cnpm 的,像我就从来没接触过企业私有的 npm;即使是企业私有的,它也不可能完全不用开源的一些 package 吧。
cnpm的两个用法是:
1、发布和安装私有前缀的包,比如 @company/package-name
2、安装公共的npm包
cnpm 只是对 npm 的一个封装,在忽略网络被强的情况下,cnpm 能做的, npm 也一般都能做
1、你说的第1点,npm 已经禁用了发布带私有前缀的包到官方的 registry 了,你说可以发布我猜测应该是像
说的搭建了一个私有的 npm 仓库,这和用 npm 或者 cnpm 无关,主要不过就是配置一个 registry 而已
2、安装公共的 npm 包它也就是配置了下 registry,把它指定到了淘宝的 registry,并且加上了其它一下环境变量
你上面说的其实都是 npm 的功能, 和 cnpm 无关,cnpm 只是帮你进一步配置了下;这些你用 smart-npm 都可以做到,你有兴趣可以去了解下 cnpm 及 smart-npm 原理,非常简单,无非是对 npm 进行的一次次封装,其实大家最终用的功能都是 npm 。
其实是你理解错了。
1、我指的cnpm是自己搭建一个
这样的私有npm,可以把一些不想公开的包发到这个私有npm上去,这样自己可以使用cnpm命令来安装,而其他人安装不了。对于一些可以公开的包,我们是直接发到npm上。
2、而cnpm命令的一个好处时,你可以cnpm install 安装私有的包,也可以安装公共的包,所以大家往往也把cnpm当作是一个npm镜像。
3、简而言之,你没弄懂cnpm是干嘛的。
我大概是弄懂楼主这个工具的用途了,『使用cnpm命令安装模块很快,但是publish模块时需要切换回npm命令,smart-npm可以省去来回切换的麻烦,它会替换原来的npm命令,使用npm命令安装模块时自动选择cnpm的镜像』
给些建议:
1、安装smart-npm时直接把淘宝的镜像配置好就行了(或写死在程序里面),不需要用户自己再手动配置(因为淘宝的镜像相对稳定,不会过一阵就没了的)
2、介绍里面废话太多,一眼看不出这个东西是干嘛的,只知道是要『干掉cnpm』
好吧,看来现在流行用私有的仓库了。
我说的只是 cnpm 那个命令
,和私有仓库没关,所以你也没有理解我说的。
如果你用了 cnpm 的私有仓库,那算了,还是用 cnpm 命令吧;我只是个人用户,用不着私有仓库,我相信有很多像我这样的人。
抱歉,文笔确实不好。
感觉你还是没明白 smart-npm 。
那就再写简明一点的介绍呗,我相信还是有一部分人没看明白的 ^_^
简而言之,你说的是 cnpm 的服务端,而我说的是 cnpm 的客户端。
语言表达是我的硬伤,我更新了一下我的 github 上的文档,有兴趣可以去瞧瞧
额,没觉得npm慢
你用了 VPN,或者不在中国 ?
支持楼主。
前排围观呼啦啦~
哦哦,我是用了代理,我没留意到代理是全局的,还以为仅浏览器。
localhost:~ jinceon$ ping
PING youtube-ui-china. (184.168.134.127): 56 data bytes
64 bytes from 184.168.134.127: icmp_seq=0 ttl=51 time=219.565 ms
64 bytes from 184.168.134.127: icmp_seq=1 ttl=51 time=218.498 ms
64 bytes from 184.168.134.127: icmp_seq=2 ttl=51 time=216.837 ms
64 bytes from 184.168.134.127: icmp_seq=3 ttl=51 time=217.746 ms
--- youtube-ui-china. ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min&#x2F;avg&#x2F;max&#x2F;stddev = 216.837&#x2F;218.161&#x2F;219.565&#x2F;1.001 ms
更新到 1.0.0 了,去掉了内嵌的 cnpm,内嵌 cnpm 很多命令会和 npm 冲突
再回头来看 smart-npm 和 cnpm 的对比,smart-npm 还在原地踏步,而 cnpm 的 install 速度,在目前业界无人能敌了。
内网用的一个小的 sinopia 跑上了
我用nrm不解释
哈哈哈 需要把 cnpm 的作者 at 出来吗
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
服务器赞助商为
,存储赞助商为
,由提供应用性能服务。
新手搭建 Node.js 服务器,推荐使用无需备案的npm安装express,已经加了-g了。但是安装成功后。还是找不到命令express。 - CNode技术社区
这家伙很懒,什么个性签名都没有留下。
如标题。谢谢。
我安装supervisor的时候就可以找到的。也是加了-g的。命令行就能找到supervisor。express却不行。
有没有人也遇到过。麻烦指教下。谢谢哈。
你是不是用nvm了。
没有啊。就是npm。我supervisor就成功了得。而且我确保加了-g了。而且我uninstall了很多次。反复试过了都不行。
我也遇到了 同样的问题,查遍了资料查不出问题。express 安装成功 也出现了 npm is ok
但是就是不行。网上资料说express 里面有.bin
目录我根本就找不到有这么个东西 咋整啊 ?、?、
我也装了N遍。环境变量咋添加咋改都不行。 换台机子也不行
求解答啊 ! 都折腾一天了快
什么系统啊,linux记得用root
是啊。我也在查资料。我想自己设置环境变量。但是还没找到。努力中。希望有解决的,看到了指导下哈。
windows 64位的。用户应该就是管理员。因为我supervisor都安装成功了得。
加我qq 探讨探讨 好有个伴 孤军奋战真扯淡
我的也是,求大神!!
难道这个问题是神问题。无解的额。你版本是最新的吗都。
求解啊 。求解!!!!!!!!!!!!!!!!!!!!!!!!!!!万分感谢!
express 已经把命令行工具分离出来了…
如果你要 Express 3
sudo npm install -g express-generator@3
express 4 的话
sudo npm install -g express-generator
其实文档已经更新过了… 所以…学习nodejs 要整天看文档…
谢谢。这英文不是太好。原来是这样子。
哈哈哈我也遇到这个问题,跟我文档一样,因为我今天才用的MAC
我以为是MAC跟我的PC不一样呢
用sudo npm install -g supervisor能成功
为毛就不能用supervisor app.js启动项目呢?
这个链接可以为你解决问题:
问题已解决
这个是不是14楼说的导致的!!!!
20楼的那个链接能解决
14楼的解决
。。。为啥要挖坟。。。有点质量行么。。。
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
服务器赞助商为
,存储赞助商为
,由提供应用性能服务。
新手搭建 Node.js 服务器,推荐使用无需备案的Nodejs可以毫不犹豫地说一个版本狂魔,时不时就发布一个版本,而且还一直没有一个1.0版本,好囧呀,对于我们这些有强迫症的人来说,的确不是好事。
下面我就说一下Nodejs中常见的更新方式。
1. 更新你已经安装的NPM库,这个很简单,只需要运行。
npm update &g
2. 更新Nodejs自身。一直依赖我都是下载最新版的源码,然后make install,及其繁琐。其实只需要运行以下2个命令即可:
npm install &g n
n可以下载任意版本的nodejs安装到本机,非常方便。
阅读(...) 评论()使用npm安装一些包失败了的解决方法(npm国内镜像介绍),安装速度跟cnpm一样哦
使用npm安装一些包失败了的解决方法(npm国内镜像介绍),安装速度跟cnpm一样哦
发布时间: 19:45:49
编辑:www.fx114.net
本篇文章主要介绍了"使用npm安装一些包失败了的解决方法(npm国内镜像介绍),安装速度跟cnpm一样哦 ",主要涉及到使用npm安装一些包失败了的解决方法(npm国内镜像介绍),安装速度跟cnpm一样哦 方面的内容,对于使用npm安装一些包失败了的解决方法(npm国内镜像介绍),安装速度跟cnpm一样哦 感兴趣的同学可以参考一下。
这个也是网上搜的,亲自试过,非常好用!
镜像使用方法(三种办法任意一种都能解决问题,建议使用第三种,将配置写死,下次用的时候配置还在,这个方法解决了我cnpm下载安装失败的问题,简直就是cnpm一样的安装速度
1.通过config命令
npm&config&set&registry&https://registry.npm.taobao.org&npm&info&underscore&(如果上面配置正确这个命令会有字符串response)2.命令行指定
npm&--registry&https://registry.npm.taobao.org&info&underscore3.编辑 ~/.npmrc 加入下面内容(PS:补充说明,node安装路径比如我的是 D:\Program Files (x86)\nodejs\node_modules\npm
找到npmrc这个文件用编辑器打开,另起一行粘贴进去保存即可。)
registry&=&https://registry.npm.taobao.org
建立或使用镜像,参考:
一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播不法有害信息!
二、互相尊重,对自己的言论和行为负责。
本文标题:
本页链接:Apache Cordova CLI 4.0 Release
We are happy to announce that Apache Cordova CLI 4.0 has been released!
We have also released Cordova-Browser 3.6.0, Cordova-Android 3.6.4, Cordova-Windows 3.6.4, and Cordova-WP8 3.6.4.
Most notable changes include:
Cordova CLI version bump to 4.0.0 to reflect our changes in .
WP8 and Windows both implemented support for --target flag
Initial support for Cordova-Browser platform.
Uninstall - recursively remove dependencies of dependencies
To upgrade: (replace android with the platform you want to update):
npm install -g cordova
cd my_project
cordova platform update android
For non-CLI projects or for pre-3.0 projects, refer to the .
Cordova CLI bumped to version 4.0
We have recently decided to update our release process to include independent releases for platforms. This means that our platform maintainers can release updates when they need to and not have to wait for other platforms to be ready to release.
Users should expect more frequent releases with bug fixes and new features. Users can always view what versions of platforms they are using in a cordova project with the cordova platform list command. Users workflow is exactly the same and updating existing projects should not be an issue.
will be released alongside our CLI.
The CLI is released with a set of default platforms pinned. For instance, this release of Cordova-CLI will include Cordova-Android@3.6.4 pinned by default. This means that when you type cordova platform add android, it will fetch and install version 3.6.4 into your project. It is also very simple to install a different version of a platform for a project if you wish by specifying the version of the platform when you are adding. Ex. cordova platform add android@3.5.1. Of course we always recommend using the latest release when possible.
In this release, all of our platforms are still in the 3.6.x range in terms of versions. Expect this to change as we do more releases.
You can read more about our new versioning strategy at .
New Platform: Cordova Browser
We have just released Browser as a platform. Add it to your projects with cordova platform add browser. This feature is intended for development purposes. We are working on adding browser support to our core plugins.
has put together detailed blog post outlining which plugins we currently support at .
Please file any issues and feature requests in our . Make sure to fill in the component field as browser.
What&#39;s new in Android
Update JS snapshot to version 3.6.4
Detect JAVA_HOME properly on Ubuntu
Fix run script&#39;s ability to use non-arch-specific APKs
Fixes build for Android when app name contains unicode characters.
Fixing bug with KitKat where the background colour would override the CSS colours on the application
Preference activation no longer occurs in CordovaActivity.onCreate()
What&#39;s new in Windows Phone 8
Updated JS snapshot to version 3.6.4
partial match support for --target
Fixing paths for npm published versions
move node_modules up to same level as package.json
add bundledDependencies
Moves node_modules from package root to bin/ folder
Fixes XHR callback failure when requested file doesn&#39;t exists
What&#39;s new in Windows
Update JS snapshot to version 3.6.4
partial match support for --target
Added bundledDependencies + fixed some whitespace
What&#39;s new in Cordova-Browser
Update JS snapshot to version 3.6.0
added initial Windows run support
No longer need to kill Chrome for macOS
added create.bat for Windows support
What&#39;s new in Cordova-CLI
Made version semVer compliant and bumped to 4.0.0
Pinned dependencies
What&#39;s new in Cordova-Plugman
Pinned dependencies
What&#39;s new in Cordova-Lib
Bumped version to 4.0.0 to be semVer compliant and to match Cordova CLI version
Pinned dependencies in package.json
Updated platforms.js for 3.6.4
Uninstall - recursively remove dependencies of dependencies
Fixes HooksRunner test - should run before_plugin_uninstall
getPluginsHookScripts to work if plugin platform not defined
Context opts should copy not reference
Fixed HooksRunner and tests. Avoided issue with parallel tests running. Added checks for handling mocked config.xml and package.json in HooksRunner and scriptsFinder. Addressed jshint issues. Renamed ScriptsFinder to scriptsFinder
Addressed community review notes: Removed commonModules from Context. Renamed Hooker and subclasses to HooksRunner and scriptsFinder. Moved scriptsRunner code into HooksRunner
Replaced CordovaError throwing with Error per @kamrik review. Extracted prepareOptions Hooker method
Docs: deprecated .cordova/hooks + other minor updates
Updated hooks documentation
Added unified hooks support for cordova app and plugins
Serve - respond with 304 when resource not modified
computeCommitId for browserify workflow fixed to handle cli and non cli workflows
prepare-browserify now supports commitId and platformVersion for cordovajs
Read config.xml after pre-prepare hooks fire
Windows Fix platform name reported by pre_package hook
Support windows merges folder for Windows platform
Added tests for browser platform
Plugin versions tested with this release
cordova-plugin-battery-status: 0.2.11
cordova-plugin-camera: 0.3.2
cordova-plugin-console: 0.2.11
cordova-plugin-contacts: 0.2.13
cordova-plugin-device: 0.2.12
cordova-plugin-device-motion: 0.2.10
cordova-plugin-device-orientation: 0.3.9
cordova-plugin-dialogs: 0.2.10
cordova-plugin-file: 1.3.1
cordova-plugin-file-transfer: 0.4.6
cordova-plugin-geolocation: 0.3.10
cordova-plugin-globalization: 0.3.1
cordova-plugin-inappbrowser: 0.5.2
cordova-plugin-media: 0.2.13
cordova-plugin-media-capture: 0.3.3
cordova-plugin-network-information: 0.2.13
cordova-plugin-splashscreen: 0.3.3
cordova-plugin-statusbar: 0.1.8
cordova-plugin-vibration: 0.3.11
Pinned Platform Versions for Cordova CLI 4.0.0
Cordova Amazon-FireOS: 3.6.3
Cordova Android: 3.6.4
Cordova BlackBerry: 3.6.3
Cordova Browser: 3.6.0
Cordova FirefoxOS: 3.6.3
Cordova iOS: 3.6.3
Cordova Ubuntu: 3.6.3
Cordova Windows: 3.6.4
Cordova WP8: 3.6.4
The following plugins were updated today: cordova-plugin-battery-status: 0.2.11 cordova-plugin-camera: 0.3.2 cordova-plugin-console: 0.2.11...
The following plugins were updated today: cordova-plugin-camera: 0.3.3 cordova-plugin-contacts: 0.2.14 cordova-plugin-file-transfer: 0.4.7...
Please enable JavaScript to view the
More Resources
Development
Apache Software Foundation
Contribute
Help Cordova move forward!
Report bugs, improve the docs, or contribute to the code.

我要回帖

更多关于 mac cnpm 安装 的文章

 

随机推荐