Click here to Skip to main content
15,881,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I am trying to export my local Reactjs project to CodeSandbox, I am following the following instructions given in the following link
CodeSandbox[^]
i ran the following command: npm install -g codesandbox
But when I try to run the command at command prompt: codesandbox ./ its giving me error as below:
codesandbox is not recognized as an internal or external command, operable program or batch file


When I ran the same command on VS Code terminal, it gave me the following error:
codesandbox : The term 'codesandbox' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try 
again.
At line:1 char:1
+ codesandbox ./
+ ~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (codesandbox:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Can anybody please help me in this regards, how can I upload my local project to Sandbox any help would be greatly helpful - thanks in advance.

What I have tried:

Googling, asking on forums and asking colleagues
Posted
Updated 26-Sep-19 6:12am

1 solution

This -g flag makes NPM install the package globally, so that the executable—in your case codesandbox—would be available from any directory, otherwise you will need to be in the same project where you installed it.

Just restart PowerShell, as the window temporarily caches the executables and might cause a problem. Restart the PowerShell window (or CMD) and you will have it, if everything is fine. Or you can check by calling this executable in the same project first.

If that doesn't work, try re-executing the statement that they provided,
$ npm install -g codesandbox
And again, make sure you open a new window, or reboot the system if the executable doesn't work.

Don't get caught in a recursion.
 
Share this answer
 
Comments
simpledeveloper 7-Oct-19 13:51pm    
i don't know buddy, for some reason this isn't going well, this is the message I am getting after running the npm install
C:\Users\aaleem\Desktop\DevelopedProjects\React\AQView\AQView\ClientApp>npm install -g codesandbox
npm WARN deprecated datauri@1.1.0: Datauri 2.0 released. See more in https://github.com/data-uri/datauri/releases/tag/v2.0.0
npm WARN deprecated mimer@0.3.2: Mimer 1.0 released. See more in https://github.com/data-uri/mimer/releases/tag/v1.0.0
npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
C:\Users\aaleem\AppData\Roaming\npm\codesandbox -> C:\Users\aaleem\AppData\Roaming\npm\node_modules\codesandbox\lib\index.js
+ codesandbox@2.1.10
updated 1 package in 18.971s


Then when I run the following script this is the error that I am getting.
C:\Users\aaleem\Desktop\DevelopedProjects\React\AQView\AQView\ClientApp>codesankbox ./
'codesankbox' is not recognized as an internal or external command,
operable program or batch file.

What is the reason buddy?
Afzaal Ahmad Zeeshan 8-Oct-19 0:35am    
You are using codesankbox ./, the name should be codesandbox ./—note the k in sandbox.
simpledeveloper 8-Oct-19 12:41pm    
No I did use the same as you said, still it gives me error buddy:
C:\Users\aaleem\Desktop\DevelopedProjects\React\AQView\AQView\ClientApp>codesandbox ./
'codesandbox' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\aaleem\Desktop\DevelopedProjects\React\AQView\AQView\ClientApp>codesandbox ./
'codesandbox' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\aaleem\Desktop\DevelopedProjects\React\AQView\AQView\ClientApp>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900