weex ui安装失败

在 SegmentFault,学习技能、解决问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。
问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
C:\Users\username&npm install -g weex-toolkit
npm ERR! code EACCES
npm ERR! errno EACCES
npm ERR! FetchError: request to http://r.cnpmjs.org/weex-toolkit failed, reason: connect EACCES 172.18.32.221:8080
at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\index.js:68:14)
at emitOne (events.js:115:13)
at ClientRequest.emit (events.js:210:7)
at Socket.socketErrorListener (_http_client.js:400:9)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at emitErrorNT (internal/streams/destroy.js:62:8)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
at process._tickCallback (internal/process/next_tick.js:161:9)
{ FetchError: request to http://r.cnpmjs.org/weex-toolkit failed, reason: connect EACCES 172.18.32.221:8080
at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\index.js:68:14)
at emitOne (events.js:115:13)
at ClientRequest.emit (events.js:210:7)
at Socket.socketErrorListener (_http_client.js:400:9)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at emitErrorNT (internal/streams/destroy.js:62:8)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
at process._tickCallback (internal/process/next_tick.js:161:9)
message: 'request to http://r.cnpmjs.org/weex-toolkit failed, reason: connect EACCES 172.18.32.221:8080',
type: 'system',
errno: 'EACCES',
code: 'EACCES' }
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
C:\Users\z\AppData\Roaming\npm-cache\_logs\T03_08_56_262Z-debug.log
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
是proxy的问题,要求node版本是 node-6.2.1整了四五个小时,终于找到解决办法:1.npm config rm proxynpm config rm http-proxynpm config rm https-proxy
2.(由于写http,后面的信息会被省略,所以改为h两个tp)npm config set proxy h两个tp://username:password@proxy:portnpm config set https-proxy h两个tp://username:password@proxy:portnpm config set registry
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
不建议无脑用管理员权限。
访问网络时返回了 EACCES,应该是网络访问被防火墙或者类似的安全工具阻止了。请检查你的防火墙或者安全工具,确保你的 nodejs 能够访问网络。
分享到微博?
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:
在 SegmentFault,学习技能、解决问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。Weex安装 - 简书
我的原文所在
1.先安装node.js ;
注:a.一定确保node.js版本高于(v0.11.x)因为在Nodejs中使用ES6 generator是从v0.11.x开始获得支持的,这个坑因为我的node.js是v0.10.x埋了一会儿的坑;b. 按照 确保 版本和工具都安装好,特别是node-gyp 如果出现:
user "root" does not have permission to access the dev dir "/Users/
sudo chmod -R 777 /Users/lymin/.node-gyp
2.安装Weex命令行程序 Weex Toolkit
npm install -g weex-toolkit
#或前面加sudo
3.命令行窗口执行 weex 回车出现:
Usage: weex foo/bar/your_next_best_weex_script_file.we
display QR code for native runtime,
-o,--output
transform weex we file to JS Bundle, output path (single JS bundle file or dir)
-s,--server
start a http file server, weex .we file will be transforme to JS bundle on the server , specify local root path using the option
4.第三步通过后
&template&
&div class="container" &
&div class="cell"&
&image class="thumb" src="http://t.cn/RGE3AJt"&&/image&
&text class="title"&JavaScript&/text&
&/template&
.cell{margin-top:10 ; margin-left:10 ; flex-direction: }
.thumb {width: 200; height: 200; }
.title {text-align: flex: 1; color: font-size: 50; }
将上面的代码保存为test.we文件
weex test.we
会在默认浏览器中打开页面:
thumb_b0c40ee1bb.png
5.查看weex版本:
weex --version
#=& info 0.4.4
详细请参见:&
北京 Ruby开发工程师(原全栈软件开发工程师) 个人网站:http://yanmin.in
安装 先安装node.js环境 sudo npm install -g weex-toolkit 安装信息异常 异常:user &root& does not have permission to access the dev dir &/Users/iluoxuan/.n...
weex是阿里巴巴开源家族的最新成员,旨在三端统一。安装过程依赖node npm,本文档重点记录本人安装过程中的报错和解决方案,假定你略懂node。使用npm install 安装时,建议切换淘宝源cnpm。 安装按照一般教程来即可:sudo cnpm install we...
Weex是2016年阿里巴巴在Qcon大会上宣布开源跨平台移动开发工具,Weex能够完美兼顾性能与动态性,让移动开发者通过简捷的前端语法写出Native级别的性能体验,并支持iOS、安卓、YunOS及Web等多端部署。 1 Weex 安装与初始化 1.1 安装NodeJS和...
受到前同事安利去尝试了一下weex,对比react-native从安装配置上来说要简单一些,但是文档真是少的可怜,这难道又是一个阿里的kpi项目?简单记录一下昨天在rmbp上的折腾。 安装homebrew /usr/bin/ruby -e &$(curl -fsSL htt...
weex 官网 搭建开发环境Weex 入坑指南:Native App 的运行与构建 前言:重要:建议使用root用户来执行下面的命令,而不是使用sudo 第一步:安装weex-toolkit 第二步:创建项目 第三步:安装依赖,安装android|ios模块 重要:在and...
正则表达式在实际项目中有很多应用,比如验证个邮箱,手机号之类的。一次偶然的机会,接手了一个bug,后台传过来的正则表达式,web端的安卓端都能够正常应用,但iOS就是不行,好一番查找之后,发现几端的正则表达式居然有些不同,可能是因为语言差异,所以会有一些区别。这个时候,往往...
文/翟德生 旗袍是女人的经典 女人一穿上旗袍 便风情万种 百花为之失色 女人穿着旗袍 走路一摇一摆 女人的头高昂 飘起来
把心放在对方身上,先感受到他的快乐、愤怒、痛苦、激动,然后聆听。先去理解别人,然后再寻求被别人理解。 聆听是一种技能,更是一种态度。它能使我们通过用耳朵听,用眼睛看,有心理解,去聆听对方真正想要传递是什么。 造物者让人拥有两只耳朵两只眼睛一张嘴,或许,就是为了让我们少说多听...
《知了》 夏天的树林里 有一种特别能鸣叫的东西 它个头不大 在天热的时候 它越能叫 叫的特别……欢 它的名子叫蝉 但蝉蛹出壳后 经风吹变后成了知了 上图那个知了 是我师傳生前所画的作品 是我从这幅画中 剪辑下来的小图 为了突出了知了的形象 知了……? 就是这样了。 《烟》 ...
是叶莲子。她是张洁《无字》里面的一位母亲。她在战乱中独自抚养着女儿,她女儿的父亲顾秋水只是给了她生命,却从未被爸爸照顾过。叶莲子的能干无人能及,可是她却仍然把顾秋水当作家里的顶梁柱。她的命运教会了我,女人足够自立,其他皆是锦上添花!当前位置:
npm 公司电脑npm安装weex失败,怎么解决?
猜你喜欢的文章
npm最近更新
npm 公司电脑npm安装weex失败,怎么解决?
来源:网络整理&&&&&时间: 0:57:25&&&&&关键词:npm
关于网友提出的“npm 公司电脑npm安装weex失败,怎么解决?”问题疑问,本网通过在网上对“npm 公司电脑npm安装weex失败,怎么解决?”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题:npm 公司电脑npm安装weex失败,怎么解决?
描述:C:\Users\username&npm install -g weex-toolkit
npm ERR! code EACCES
npm ERR! errno EACCES
npm ERR! FetchError: request to http://r.cnpmjs.org/weex-toolkit failed, reason: connect EACCES 172.18.32.221:8080
at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\index.js:68:14)
at emitOne (events.js:115:13)
at ClientRequest.emit (events.js:210:7)
at Socket.socketErrorListener (_http_client.js:400:9)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at emitErrorNT (internal/streams/destroy.js:62:8)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
at process._tickCallback (internal/process/next_tick.js:161:9)
{ FetchError: request to http://r.cnpmjs.org/weex-toolkit failed, reason: connect EACCES 172.18.32.221:8080
at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\index.js:68:14)
at emitOne (events.js:115:13)
at ClientRequest.emit (events.js:210:7)
at Socket.socketErrorListener (_http_client.js:400:9)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at emitErrorNT (internal/streams/destroy.js:62:8)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
at process._tickCallback (internal/process/next_tick.js:161:9)
message: 'request to http://r.cnpmjs.org/weex-toolkit failed, reason: connect EACCES 172.18.32.221:8080',
type: 'system',
errno: 'EACCES',
code: 'EACCES' }
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
C:\Users\z\AppData\Roaming\npm-cache\_logs\T03_08_56_262Z-debug.log解决方案1:遇到这种问题需要从错误本身出发分析。关键是这句:Please try running this command again as root/Administrator.
权限问题。所以可以试下管理员权限安装。gitbash,powershell或者cmd都有管理员模式。你用cmd开启管理员模式的方式:1.应用程序搜索到cmd,右键使用管理员模式打开2.win+x,选择管理员模式cmd命令行打开的方法我没找到。更快捷的powershell可以用命令切换管理员权限。可以参考这个问题:https://segmentfault.com/q/10...解决方案2:管理员权限试过了吗?npm ERR! Please try running this command again as root/Administrator.解决方案3:不建议无脑用管理员权限。访问网络时返回了 EACCES,应该是网络访问被防火墙或者类似的安全工具阻止了。请检查你的防火墙或者安全工具,确保你的 nodejs 能够访问网络。解决方案4:是proxy的问题,要求node版本是 node-6.2.1整了四五个小时,终于找到解决办法:1.npm config rm proxynpm config rm http-proxynpm config rm https-proxy2.(由于写http,后面的信息会被省略,所以改为h两个tp)npm config set proxy h两个tp://username:password@proxy:portnpm config set https-proxy h两个tp://username:password@proxy:portnpm config set registry http://registry.npmjs.org/
以上介绍了“npm 公司电脑npm安装weex失败,怎么解决?”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/4390903.html
上一篇: 下一篇:
npm相关图片
npm相关文章在 SegmentFault,学习技能、解决问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。
问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
cnpm@4.5.0 (/usr/local/lib/node_modules/cnpm/parse_argv.js)
npm@3.10.10 (/usr/local/lib/node_modules/cnpm/node_modules/npm/lib/npm.js)
node@7.7.2 (/usr/local/Cellar/node/7.7.2/bin/node)
npminstall@2.26.4 (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/index.js)
prefix=/usr/local
darwin x64 16.1.0
registry=https://registry.npm.taobao.org
执行cnpm install -g weex-toolkit报错:
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
mac全局安装要加sudo,如果加了之后不能解决问题,试着用npm安装看看。
sudo cnpm install -g weex-toolkit
同步到新浪微博
分享到微博?
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:
在 SegmentFault,学习技能、解决问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。【weex】第一次尝试,weex windows下的环境搭建到第一个完整的app
安装 Node.js
node.js需要4.0+官网下载地址安装教程请看这里
安装 weex-toolkit
安装好node.js后,打开CMD工具现在安装weex-toolkit,这是weex的集成环境,有了weex-toolkit就可以使用weex命令了。
默认的npm默认的是https://registry.npmjs.org/这个源,下载很慢
先切换到淘宝的源,会快很多
npm config set registry https://registry.npm.taobao.orgnpm install -g weex-toolkit
安装完毕,验证下
初始化项目hello weex
先建立一个app文件夹,我是这个目录D:\work_weex\myTest
然后使用cmd进入myTest这个目录
项目初始化
接着安装依赖
npm install
项目中会增加这么个目录
D:\work_weex\myTest\node_modules
项目目录结构:
src-代码目录
index-浏览器启动页面
观察package.json里面修改端口号
在 package.json 中,已经配置好了几个常用的 npm script,分别是:
build: 源码打包,生成 JS Bundledev: webpack watch 模式,方便开发serve: 开启静态服务器debug: 调试模式
"name": "myTest",
"description": "myTest",
"version": "0.1.0",
"private": true,
"main": "index.js",
"keywords": [
"scripts": {
"build": "webpack",
"dev": "webpack & serve -p 8070",
"serve": "node build/init.js && serve -p 8070",
"debug": "weex-devtool"
现在试试启动这个项目
npm run dev
现在浏览器访问一下localhost:8070会出现如下界面
好了,现在我们已经启动起来了这个项目。
自己写个文件跑跑
在src中创建一个name.we
&template&
&text repeat="item in items" class="text {{item.sex}}"&{{item.name}}&/text&
&/template&
.text{ width:750; padding-top: 10 padding-bottom: 10justify-content:text-align: color:#ffffff}
.male { background-color: #9999 }
.female { background-color: #ff9999; }
module.exports = {
再创建个home.we
&template xmlns="http://www.w3.org/1999/html"&
&div style="width: 750; height: 200;"&
&image class="img" src={{imageUrl}}&&/image&
&input ref="input" class="input" type="text"
value={{input}} oninput="oninput" /&
&a class="button"&
&text class="text" onclick="add"&添加他&/text&
&name items = {{items}}&&/name&
&/template&
module.exports = {
imageUrl: 'https://gtms02.alicdn.com/tps/i2/TB1QHKjMXXXXXadXVXX20ySQVXX-512-512.png',
input:'测试',
sex:'male',
items:['x','y']
methods: {
oninput (event) {
console.log('ominput:', event.value)
this.input = event.
if(this.input === '')
this.items.unshift({name:this.input,sex:this.sex})
this.input = "";
if(this.sex === 'female'){
this.sex = 'male';
this.sex = 'female';
.img { width: 200; height: 200; margin-left: 275}
font-size: 50
width: 650
margin-top: 50
margin-left: 50
padding-top: 20
padding-bottom: 20
padding-left: 20
padding-right: 20
color: #666666;
border-width: 2
border-style:
border-color: #41B883;
width: 450
margin-top: 30
margin-bottom: 30
margin-left: 150
padding-top: 20
padding-bottom: 20
border-width: 2
border-style:
border-color: #DDDDDD;
background-color: #F5F5F5
font-size: 30
color: #666666;
text-align:
在cmd上运行
浏览器会自动打开,并且还支持代码一保存就自动刷新界面的功能。
点着玩吧~~
最后使用命令导出js:
weex home.we --output home.js
把这个js发给客户端集成即可
没有更多推荐了,

我要回帖

更多关于 weex 的文章

 

随机推荐