在 ubuntu 14.04 上我安装了 Sublime Text 2 和一个名为less2css。例如,当我尝试保存时MAIN.less
,文件已保存,但未编译到MAIN.css
。Sublime 提醒我usr/bin/env node no such file or directory
。
我不知道为什么 Sublime 需要这个文件,文件存在并且这个文件的权限对我来说看起来没问题。
编辑:当我从 commondline 执行此操作时,我看到了相同的警报
root@mainPC2:/home/oskar/WORK/__MY/_v10/less# pwd
/home/oskar/WORK/__MY/_v10/less
root@mainPC2:/home/oskar/WORK/__MY/_v10/less# ls -la
razem 12
drwxrwxr-x 2 oskar oskar 4096 wrz 21 15:05 .
drwxrwxr-x 4 oskar oskar 4096 wrz 21 15:06 ..
-rw-rw-r-- 1 oskar oskar 42 wrz 21 16:23 main.less
root@mainPC2:/home/oskar/WORK/__MY/_v10/less# lessc main.less > main.css
/usr/bin/env: node: Nie ma takiego pliku ani katalogu
我已经安装了nodejs
(最新版本)
root@mainPC2:/home/oskar/WORK/__MY/_v10/less# sudo apt-get install nodejs
Czytanie list pakietów... Gotowe
Budowanie drzewa zależności
Odczyt informacji o stanie... Gotowe
nodejs jest już w najnowszej wersji.
nodejs zaznaczony jako zainstalowany ręcznie.
0 aktualizowanych, 0 nowo instalowanych, 0 usuwanych i 0 nieaktualizowanych.
npm install -g less
一开始就是这样的
root@mainPC2:/home/oskar# sudo npm install -g less
npm http GET https://registry.npmjs.org/less
npm http 304 https://registry.npmjs.org/less
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/source-map
npm http GET https://registry.npmjs.org/clean-css
npm http GET https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/clean-css
npm http 304 https://registry.npmjs.org/source-map
npm http 304 https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/minimist/0.0.8
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/mime-types
npm http GET https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/tough-cookie
npm http GET https://registry.npmjs.org/form-data
npm http GET https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/hawk/1.1.1
npm http GET https://registry.npmjs.org/aws-sign2
npm http GET https://registry.npmjs.org/stringstream
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/amdefine
npm http 304 https://registry.npmjs.org/minimist/0.0.8
npm http 304 https://registry.npmjs.org/forever-agent
npm http 304 https://registry.npmjs.org/mime-types
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/json-stringify-safe
npm http 304 https://registry.npmjs.org/node-uuid
npm http 304 https://registry.npmjs.org/tough-cookie
npm http 304 https://registry.npmjs.org/form-data
npm http 304 https://registry.npmjs.org/tunnel-agent
npm http 304 https://registry.npmjs.org/oauth-sign
npm http 304 https://registry.npmjs.org/http-signature
npm http 304 https://registry.npmjs.org/hawk/1.1.1
npm http 304 https://registry.npmjs.org/aws-sign2
npm http 304 https://registry.npmjs.org/stringstream
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/amdefine
npm http GET https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/asn1/0.1.11
npm http GET https://registry.npmjs.org/assert-plus/0.1.2
npm http GET https://registry.npmjs.org/ctype/0.5.2
npm http 304 https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/punycode
npm http 304 https://registry.npmjs.org/asn1/0.1.11
npm http 304 https://registry.npmjs.org/assert-plus/0.1.2
npm http 304 https://registry.npmjs.org/ctype/0.5.2
npm http GET https://registry.npmjs.org/sntp
npm http GET https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/cryptiles
npm http GET https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/punycode
npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/hoek
npm http 304 https://registry.npmjs.org/cryptiles
npm http 304 https://registry.npmjs.org/boom
npm http 304 https://registry.npmjs.org/sntp
/usr/local/bin/lessc -> /usr/local/lib/node_modules/less/bin/lessc
[email protected] /usr/local/lib/node_modules/less
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
我将非常感激您的帮助,谢谢
答案1
将命令重命名nodejs
为node
:
sudo ln -s $(which nodejs) /usr/local/bin/node
在命令行中解决了这个问题,之后我重新安装了 Sublime。此后一切正常。