Open fadyhashmi opened 7 years ago
The reason is certificate has expired
, as workaround you can use this solution http://stackoverflow.com/a/21961005, it's not secure, but works, you can use it something like this in allcount.js
file:
mkdir(path.join(appName, 'app-config'), function () {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
request.post('https://allcountjs.com/api/app-template-for-cli-init', {json: packageJson}, function (err, httpResponse, body) {
var fileCounter = 0;
if (err || httpResponse.statusCode != 200) {
console.log("error: " + err);
if (httpResponse) {
console.log("response: " + httpResponse.statusCode + " " + httpResponse.body);
}
} else body.files.forEach(function (file) {
write(path.join(appName, 'app-config', file.fileName), file.content, 0666, function () {
fileCounter++;
if (body.files.length === fileCounter) {
var prompt = launchedFromCmd() ? '>' : '$';
console.log();
console.log(' install dependencies:');
console.log(' %s cd %s && npm install', prompt, appName);
console.log();
console.log(' run the app:');
var mongoUrl = "mongodb://localhost:27017/" + appName;
if (launchedFromCmd()) {
console.log(' %s SET DB_URL=%s:* & npm start', prompt, mongoUrl);
} else {
console.log(' %s DB_URL=%s:* npm start', prompt, mongoUrl);
}
console.log();
console.log(' or');
console.log(' %s allcountjs run', prompt);
console.log();
}
});
});
})
})
@Alexey8127 So where is all this code going? in the node_module for the global allcountjs-cli ?
@cristiandan yes, you can try to check the allcount.js
path in error message, like in the first message:
Initializing "test" application using "twenty-two-lines" template...
create : test
create : test\app-config
create : test\package.json
C:\Users\Fahad\AppData\Roaming\npm\node_modules\allcountjs-cli\bin\allcount.js:85
body.files.forEach(function (file) {
.............
I have a similar issue, but I suspect it is because I am behind a proxy. Googling for it I can't find a specific way to set up allcount to use a proxy.
just type
NODE_TLS_REJECT_UNAUTHORIZED=0 allcountjs init
I am having issue init allcountjs applications
node -v is v6.9.1 and npm -v 3.10.8