編輯:它似乎工作時,我做任何事情之前運行C:\ Program Files \ nodejs \ nodevars.bat。儘管如此,永久的解決方案仍然令人愉快。離子不被識別爲外部或內部命令
編輯2:時運作的溶液對我來說是到Ç添加:\用戶{用戶名} \應用程序數據\漫遊\ NPM之前C:\的Android \ NPM在PATH變量,然後重新啓動命令提示符。
我試圖在Windows 10上安裝Ionic,並且無法運行它。我收到錯誤消息:「Ionic不被識別爲外部或內部命令」。
我已經安裝了Cordova,因爲我正在測試jQuery Mobile,並且我認爲出於這個原因,我可能會在我的PATH環境變量中發生一些奇怪的事情。下面是它的樣子:
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;%ANT_HOME%\bin;%JAVA_HOME%\bin;%ANDROID_HOME%\platform-tools\;%ANDROID_HOME%\tools\;C:\Program Files\nodejs\;C:\Program Files\nodejs\node_modules\npm\bin\;C:\Users\Pierre\AppData\Roaming\npm\;C:\Android\npm\;C:\Android\npm\node_modules\cordova\bin\;
當我運行科爾多瓦-v,它的工作原理,顯示出科爾多瓦安裝正確(我也知道,因爲我與jQuery Mobile的正常運行)。
我試着清理npm緩存並再次安裝離子,無論是否有管理員狀態,它都沒有改變任何東西。這是當我運行NPM安裝-g離子輸出:我有很多的警告
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue.
npm WARN deprecated [email protected]: use uuid module instead
npm WARN deprecated [email protected]: use uuid module instead
C:\Users\Pierre\AppData\Roaming\npm\ionic -> C:\Users\Pierre\AppData\Roaming\npm\node_modules\ionic\bin\ionic
C:\Users\Pierre\AppData\Roaming\npm
`-- [email protected]
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules\ionic\node_modules\chokidar\node_modules\fsevents):
npm WARN potsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN In [email protected] replacing bundled version of cross-spawn with [email protected]
npm WARN In [email protected] replacing bundled version of semver with [email protected]
npm WARN In [email protected] replacing bundled version of mime-types with [email protected]
npm WARN In [email protected] replacing bundled version of form-data with [email protected]
npm WARN In [email protected] replacing bundled version of request with [email protected]
npm WARN In [email protected] replacing bundled version of ionic-app-lib with [email protected]
,但我不知道這是否是在所有相關。 謝謝你的幫助。
非常感謝,它的工作原理。我想我已經做到了,但是我沒有重新啓動命令提示符。 – Driblou
不客氣:)是的,有時我也忘了重新啓動cmd aha – DevMoutarde