forked from coasys/ad4m
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremovePnpm.js
More file actions
31 lines (27 loc) · 781 Bytes
/
removePnpm.js
File metadata and controls
31 lines (27 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const fs = require('fs');
// Read the package.json file
fs.readFile('package.json', 'utf8', (err, data) => {
if (err) {
console.error('Error reading package.json:', err);
return;
}
// Parse the JSON data
let packageJson;
try {
packageJson = JSON.parse(data);
} catch (error) {
console.error('Error parsing package.json:', error);
return;
}
// Remove pnpm-related configurations
delete packageJson.pnpm;
delete packageJson.pnpmOverrides;
// Write the modified JSON back to package.json file
fs.writeFile('package.json', JSON.stringify(packageJson, null, 2), 'utf8', (err) => {
if (err) {
console.error('Error writing package.json:', err);
return;
}
console.log('package.json updated successfully!');
});
});