You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 15, 2019. It is now read-only.
PS C:\Users\jiayu\Documents\some-project> functions deploy helloWorld
[eval]:1
'console.log(Object.keys(require(C:\Users\jiayu\Documents\some-project)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Invalid or unexpected token
at Object.exports.runInThisContext (vm.js:76:16)
at Object.<anonymous> ([eval]-wrapper:6:22)
at Module._compile (module.js:570:32)
at bootstrap_node.js:357:29
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
'{}))'' is not recognized as an internal or external command,
operable program or batch file.
ERROR: Command failed: node -e 'console.log(Object.keys(require("C:\Users\jiayu\Documents\some-project") || {}))'
[eval]:1
'console.log(Object.keys(require(C:\Users\jiayu\Documents\some-project)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Invalid or unexpected token
at Object.exports.runInThisContext (vm.js:76:16)
at Object.<anonymous> ([eval]-wrapper:6:22)
at Module._compile (module.js:570:32)
at bootstrap_node.js:357:29
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
'{}))'' is not recognized as an internal or external command,
operable program or batch file.
PS C:\Users\jiayu\Documents\some-project>
There appear to be two underlying issues causing this:
cmd.exe handling of single quotes - cmd.exe doesn't recognise the argument to node -e wrapped in single quotes and tries to execute the portion after the space
Node.js path module behaviour on Windows - path.resolve uses backslash path separators on Windows which causes problems when the path is used as a command line argument.
Swapping the single quotes and double quotes and replacing backslashes in the resolved path with forward slashes fixed the issue for me:
Description
This line
at https://github.com/GoogleCloudPlatform/cloud-functions-emulator/blob/master/src/cli/controller.js#L100 causes functions deploy to fail on Windows.
Steps to reproduce
Follow instructions on https://github.com/GoogleCloudPlatform/cloud-functions-emulator/wiki until step 5
This will fail on Windows:
There appear to be two underlying issues causing this:
path
module behaviour on Windows -path.resolve
uses backslash path separators on Windows which causes problems when the path is used as a command line argument.Swapping the single quotes and double quotes and replacing backslashes in the resolved path with forward slashes fixed the issue for me:
Thanks!
The text was updated successfully, but these errors were encountered: