回答編集履歴

3

似たような環境構築

2017/06/23 06:55

投稿

mosapride
mosapride

スコア1480

test CHANGED
@@ -59,3 +59,153 @@
59
59
  参考↓
60
60
 
61
61
  [http://qiita.com/Quramy/items/2d019474bdcf692f7c1a](http://qiita.com/Quramy/items/2d019474bdcf692f7c1a)
62
+
63
+
64
+
65
+
66
+
67
+ ---
68
+
69
+ 追記、dockerでcentos6.9ですけど同じようなバージョンで試してみました
70
+
71
+
72
+
73
+ ```
74
+
75
+ [root@4d92eff12dd7 ~]# cat /etc/redhat-release
76
+
77
+ CentOS release 6.9 (Final)
78
+
79
+ [root@4d92eff12dd7 ~]# npm --version ## 古いから上げる
80
+
81
+ 3.10.10
82
+
83
+ [root@4d92eff12dd7 ~]# npm update -g npm # npmのバージョンを上げる
84
+
85
+ [root@4d92eff12dd7 ~]# npm --version
86
+
87
+ 5.0.3
88
+
89
+ [root@4d92eff12dd7 ~]# node --version
90
+
91
+ v6.11.0
92
+
93
+
94
+
95
+ [root@4d92eff12dd7 ~]# cd /root/
96
+
97
+ [root@4d92eff12dd7 ~]# ls
98
+
99
+ anaconda-ks.cfg install.log install.log.syslog
100
+
101
+ [root@4d92eff12dd7 ~]# ls -la
102
+
103
+ total 56
104
+
105
+ dr-xr-x--- 1 root root 4096 Jun 23 06:36 . ## npmrcが無いだと...
106
+
107
+ drwxr-xr-x 1 root root 4096 Jun 23 06:34 ..
108
+
109
+ -rw------- 1 root root 324 Jun 23 06:36 .bash_history
110
+
111
+ -rw-r--r-- 1 root root 18 May 20 2009 .bash_logout
112
+
113
+ -rw-r--r-- 1 root root 176 May 20 2009 .bash_profile
114
+
115
+ -rw-r--r-- 1 root root 374 Jun 23 06:36 .bashrc
116
+
117
+ -rw-r--r-- 1 root root 100 Sep 23 2004 .cshrc
118
+
119
+ drwxr-xr-x 5 root root 4096 Jun 23 06:36 .nvm
120
+
121
+ drwxr----- 3 root root 4096 Jun 23 06:35 .pki
122
+
123
+ -rw-r--r-- 1 root root 129 Dec 3 2004 .tcshrc
124
+
125
+ -rw------- 1 root root 2687 Jun 5 02:56 anaconda-ks.cfg
126
+
127
+ -rw-r--r-- 1 root root 7281 Jun 5 02:56 install.log
128
+
129
+ -rw-r--r-- 1 root root 1680 Jun 5 02:56 install.log.syslog
130
+
131
+
132
+
133
+
134
+
135
+ ### 試しにインストール
136
+
137
+ [root@4d92eff12dd7 test2]# npm install node-sass --save
138
+
139
+ npm WARN prefer global node-gyp@3.6.2 should be installed with -g
140
+
141
+
142
+
143
+ > node-sass@4.5.3 install /root/test2/node_modules/node-sass
144
+
145
+ > node scripts/install.js
146
+
147
+
148
+
149
+ Cached binary found at /root/.npm/node-sass/4.5.3/linux-x64-48_binding.node
150
+
151
+
152
+
153
+ > node-sass@4.5.3 postinstall /root/test2/node_modules/node-sass
154
+
155
+ > node scripts/build.js
156
+
157
+
158
+
159
+ Binary found at /root/test2/node_modules/node-sass/vendor/linux-x64-48/binding.node
160
+
161
+ Testing binary
162
+
163
+ Binary is fine
164
+
165
+ npm notice created a lockfile as package-lock.json. You should commit this file.
166
+
167
+ npm WARN test2@1.0.0 No description
168
+
169
+ npm WARN test2@1.0.0 No repository field.
170
+
171
+
172
+
173
+ + node-sass@4.5.3
174
+
175
+ added 180 packages in 7.304s # 問題なし
176
+
177
+
178
+
179
+ ```
180
+
181
+
182
+
183
+ 中身見てなかった。
184
+
185
+ ```
186
+
187
+ [root@4d92eff12dd7 test2]# npm config ls
188
+
189
+ ; cli configs
190
+
191
+ metrics-registry = "https://registry.npmjs.org/"
192
+
193
+ scope = ""
194
+
195
+ user-agent = "npm/5.0.3 node/v6.11.0 linux x64"
196
+
197
+
198
+
199
+ ; node bin location = /root/.nvm/versions/node/v6.11.0/bin/node
200
+
201
+ ; cwd = /root/test2
202
+
203
+ ; HOME = /root
204
+
205
+ ; "npm config ls -l" to show all defaults.
206
+
207
+
208
+
209
+ [root@4d92eff12dd7 test2]#
210
+
211
+ ```

2

追記2

2017/06/23 06:55

投稿

mosapride
mosapride

スコア1480

test CHANGED
@@ -31,3 +31,31 @@
31
31
  公式のnpmトラブルシューティング↓。
32
32
 
33
33
  [https://docs.npmjs.com/troubleshooting/try-the-latest-stable-version-of-node](https://docs.npmjs.com/troubleshooting/try-the-latest-stable-version-of-node)
34
+
35
+
36
+
37
+
38
+
39
+ ---
40
+
41
+ 追記
42
+
43
+ privateリポジトリを参照しているのですかね?
44
+
45
+ 使ったことないのですが
46
+
47
+ ```
48
+
49
+ ${home}/.npmrc
50
+
51
+
52
+
53
+ registry=http://192.168.1.100:4873
54
+
55
+ ```
56
+
57
+ があったら削除すればうまくいくかもしれません。
58
+
59
+ 参考↓
60
+
61
+ [http://qiita.com/Quramy/items/2d019474bdcf692f7c1a](http://qiita.com/Quramy/items/2d019474bdcf692f7c1a)

1

追記

2017/06/23 04:29

投稿

mosapride
mosapride

スコア1480

test CHANGED
@@ -9,3 +9,25 @@
9
9
  npm cache clean
10
10
 
11
11
  ```
12
+
13
+
14
+
15
+ ---
16
+
17
+ 追記
18
+
19
+
20
+
21
+ ```
22
+
23
+ npm config ls -l
24
+
25
+ ```
26
+
27
+ でchache = にディレクトリが書かれています。
28
+
29
+
30
+
31
+ 公式のnpmトラブルシューティング↓。
32
+
33
+ [https://docs.npmjs.com/troubleshooting/try-the-latest-stable-version-of-node](https://docs.npmjs.com/troubleshooting/try-the-latest-stable-version-of-node)