简体   繁体   中英

Can't build Cordova Windows 8 project with node.js and npm

I try to install node-v0.10.26-x64.msi and cordova(PhoneGap) 3.4.0 for Windows 8. But it occurs an error on Windows 8.1(x64).

This is a result on Windows 8.1 command prompt(as an Administrator) for building:

C:\Windows\system32>npm install -g cordova
C:\Windows\system32>cd c:\data
c:\Data>cordova create abc com.aaa.bbb ccc
c:\Data>cd abc
c:\Data\abc>cordova platform add windows8
Project created
[Error: Non-whitespace before first tag.
Line: 0
Column: 1
Char: ]
c:\Data\abc>cordova build
[Error: Non-whitespace before first tag.
Line: 0
Column: 1
Char: ]
Running command: cmd args=["/c","c:\\Data\\abc\\platforms\\windows8\\cordova\\bu
ild"]
cordova library for "windows8" already exists. No need to download. Continuing.
Generating config.xml from defaults for platform "windows8"
Calling plugman.prepare for platform "windows8"
Preparing windows8 project
Procesabcg configuration changes for plugins.
creating jsproj from project at : C:\Data\abc\platforms\windows8\CordovaApp.jspr
oj
Iterating over installed plugins: []
Writing out cordova_plugins.js...
[Error: Non-whitespace before first tag.
Line: 0
Column: 1
Char: �]
Running command: cmd args=["/c","C:\\Data\\abc\\platforms\\windows8\\cordova\\bu
ild"]
c:\Data\abc\platforms\windows8\cordova\lib\build.js(57, 5) WshShell.Exec: file not found

Non-whitespace issue was solved by adding "contents = contents.substring(contents.indexOf("<"));" to "contents = fs.readFileSync(filename, 'utf-8')" into "node_modules\\cordova..\\xml-helpers.js".

But "build.js(57, 5) WshShell.Exec" error is not resolve.

This is not a total answer, but I don't have enough reputation to comment your post.

My question is what is your computer login name? Does it contain a space?

I had the same problem when my login was "Quentin B". I had to change it to "QuentinB" and it worked.

Furthermore, do you have the same problem if you try to install another platform (android for example)?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM